BAT file-Move

August 17, 2010 at 01:31:42
Specs: Windows 7
Hi guys,

Im basiccaly making a simple program. Anywyas i have all the files in need its all ready to go... Ok what i need to do is make the batch file that creates folders and places them where i want them...(after batch file is done ill convert to exe)

Ok here is the qs...
1. i know that:
mkdir %New Folder =new folder on desktop
mkdir %New Folder2 =new folder called new folder2 on desktop

i want to put new folder2 into new folder 1. keeping in mind both files are on desktop..

2. And i also want to know how to put a file such as say an image for example call it hi.jpg into new foler2 which is in new folder.

Thankyou very much guys

See More: BAT file-Move

August 17, 2010 at 08:42:17
I would just use the cd command to go to the directory/folder you want to make a new folder in. Then use the mkdir or md command to make a new folder there. So you would use mkdir YOURNEWFOLDERNAME or md YOURNEWFOLDERNAME and it should make a folder in the place where you said in the cd command. For your second question you can use the cd command to locate the folder where the picture is. Then use this command to copy it to the new folder you made. copy "YOURFILE.JPG" "DIRECTORY/YOURFILE.JPG" Hope I helped

Report •

August 18, 2010 at 04:33:56
Hey thanks mate...
Say in this program i wanted it to make a folder called folder1 which goes to desktop and the folder in that on desktop and the stuff in the folder in folder1

Thats where i get lost.. is their a command so that it goes to desktop without having to have the Users\username\folder?

And also can you if possible give me an example of the cd and md? And again thankyou soo much man.

Report •

August 18, 2010 at 18:23:48
You can use the environment variable %userprofile%\Desktop, but that requires the CD command

CD %UserProfile%\Desktop
MKDIR "Folder 1"
CD "Folder 1"
MKDIR "Folder 2"
COPY "P:\ath\hi.jpg" "%UserProfile%\Desktop\Folder 1\Folder 2"

Report •

Related Solutions

August 19, 2010 at 06:17:46
E:\>md /?
Creates a directory.

MKDIR [drive:]path
MD [drive:]path

If Command Extensions are enabled MKDIR changes as follows:

MKDIR creates any intermediate directories in the path, if needed.
For example, assume \a does not exist then:

    mkdir \a\b\c\d

is the same as:

    mkdir \a
    chdir \a
    mkdir b
    chdir b
    mkdir c
    chdir c
    mkdir d

which is what you would have to type if extensions were disabled.

Report •

Ask Question