This is easily done with a batch file.
To avoid any misunderstands it would be helpful if you posted an actual example of what you're trying to achieve, i.e. something with real folder names.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello all. I am of the vintage when i upgraded from a pc to an xt i thought i was king kong. (1984/85). Back then I would create a batch file to automate steps and it was all too easy. Move forward to 2018 and I am bamboozled trying to do the same. I simply want to move to a directory (manually) then create 3 additional directories and name them within the one I am in. Can someone please suggest a simple App that will do this. Thankyou
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
This is easily done with a batch file.
To avoid any misunderstands it would be helpful if you posted an actual example of what you're trying to achieve, i.e. something with real folder names.
Yes as mentioned, the batch file used to work. Just for the sake of this case, lets say I want to:
create a new directory and name it Invoices.
create a new directory and name it statements
create a new directory and name it credit notes
all within the same directory.
Thank you
While you could use macros to achieve your aim, I would discourage you from doing this. In a multitasking environment, macros are quite unreliable. A far better method would use an additional folder context menu item. You would simply right-click the current folder (e.g. "2018"), then left-click "Create Subfolders". This would give you the nominated subfolders under 2018.
Here are the steps to install this tool:
Code Line
cmd /c md c:\Tools & cd 2>"c:\Tools\Create Subfolders.bat" & pause
Script
@echo off
goto :Start
Create three subfolders in the current folder.
On the first run, create a registry entry for
an extra context menu item.
17.5.2018 FNL
:Start
if not exist "c:\Tools\Create Subfolders.reg" (
echo> "c:\Tools\Create Subfolders.reg" Windows Registry Editor Version 5.00
echo>>"c:\Tools\Create Subfolders.reg" [HKEY_CLASSES_ROOT\Directory\shell\Create Subfolders]
echo>>"c:\Tools\Create Subfolders.reg" [HKEY_CLASSES_ROOT\Directory\shell\Create Subfolders\command]
echo>>"c:\Tools\Create Subfolders.reg" @=""C:\Tools\Create Subfolders.bat" "%%1""
)
reg query "HKEY_CLASSES_ROOT\Directory\shell\Create Subfolders" 1>nul 2> nul
if %ErrorLevel% EQU 0 (
if not exist "%1\Invoices" md "%1\Invoices"
if not exist "%1\Statements" md "%1\Statements"
if not exist "%1\Credit Notes" md "%1"Credit Notes"
) else (
"c:\Tools\Create Subfolders.reg"
)
Wow
Frederik Long
Thankyou ever so much for your response but your knowledge and mine are light years apart as this syntax is way beyond me and further, more complex than I was looking for. Some more background if you would be so kind to consider it. I have say 40 Suppliers to my little shop and I am wanting to save wasting paper on printing out all of the invoices, statements and credit not they send me so I wanted to simply create a supplier directory say 'Utility Company' then within that directory, create 3 directories named "invoices" , 'statements' and 'credits'. As I have 40 suppliers, I simply wanted to create these 3 directories as noted above for each supplier.
So what I wanted to do was very simple, a 1 off task and thats about it. For this reason, to create the 'automation' needs to be quick and easy. I downloaded an app called "tiny ???' and could not get that to do what I wanted ... at this stage, I could have done the task manually by now and been finished but .... I downloaded an app Pulovers Macro Creator and quickly realized that this program was very good but way too complicated over the top for what I am needing.
So Mr Frederik, am I a lost cause or is there a simply way or application to do this task. Thankyou even for taking the time to read all of this.
Further, i am interested in learning how to code windows to create little scripts for my own purpose. Could you please direct me to where I can learn the syntax of what you did above please
Kind Regards
darren
.
So Mr Frederik, am I a lost cause or is there a simply way or application to do this task. Thankyou even for taking the time to read all of this.
Further, i am interested in learning how to code windows to create little scripts for my own purpose. Could you please direct me to where I can learn the syntax of what you did above please
The method I gave you is simple. It looks complicated in my post because I needed to make very sure that someone with little technical knowledge would succeed no matter what. It's much like describing a car wheel change. To a mechanic I would say "Change the wheel!". To a novice I would need to explain where to car jack is, how to jack up the car, how to undo the nuts (clockwise or anticlockwise?) etc. etc. If you feel that you can trust me then I'll install my script for you under remote control within a couple of minutes.
Batch files in their simplest form are a collection of console commands. This implies that you must know your console commands before you can put them inside batch files: copy, del, md, echo, type, setetc. There are a few dozen of these that you would need to know. The console command help gives you a nice collection.
In their advanced form batch files use variables and conditional execution. This is a bit of a black art and requires a combination of experience plus trial and error. A Google query such as help batch files will probably get you lots of help. The best way is to try something simple, then build things up gradually. I'm happy to help you if you have a specific question.
Note also that batch files are not "nice" from a programmer's point of view. They are "quick and dirty". If you want a nice scriping language then you could use VB Script or PowerShell. VB Script is somewhat chatty and requires an IDE (Integrated Development Environment) in order for you to be really successful. PowerShell is incredibly powerful and very terse. I never quite managed to wrap my mind around it. VB Script is my game.