You are here

batch file

8 posts / 0 new
Last post
gjjh25
Offline
Last seen: 1 month 2 weeks ago
Joined: 2006-04-03 07:38
batch file

I am looking for a batch file that will copy certain files and folders to the c: drive, and then another batch file that would delete them when i have finished.

Is this possible?

if so could someone give an idea of how to do it please?

m2
Offline
Last seen: 13 years 3 months ago
Joined: 2006-12-12 12:00
Yes, it is possible. try the

Yes, it is possible.
try the following batch file:
copy /?
pause>nul

After you run it, combine the result with info from here.

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

Bahamut
Bahamut's picture
Offline
Last seen: 12 years 5 months ago
Joined: 2006-04-07 08:44
Will you supply the file

Will you supply the file names as arguments, or do you want them "hardcoded" into the batch file?

Vintage!

gjjh25
Offline
Last seen: 1 month 2 weeks ago
Joined: 2006-04-03 07:38
i work in different places,

i work in different places, so all i wnt is to copy over a few regular folders to the c drive that i use and then to delete them when i have down via batch file at the end of the day

Graham Yates

Ed_P
Offline
Last seen: 5 years 7 months ago
Joined: 2007-02-19 09:09
Try this

@echo off
title My setup

if exist "%AppData%\MySetup\*.*" (
echo Deleting my setup files from the host machine
rd "%AppData%\MySetup" /s /q
echo Done. Press Enter to exit.
pause > nul
exit )

echo Copying my setup files to the host machine
md "%AppData%\MySetup"
xcopy "myfolder1"\*.* to "%AppData%\MySetup\myfolder1\" /y
:: Repeat the above line for each of your folders
echo Copying complete
dir "%AppData%\MySetup\"
echo Press Enter to exit
pause > nul

Save the above lines as a .cmd file on the USB stick.
Edit the "myfolder1" names to match the names of your folders.
Repeat the "myfolder1" line for each folder you wish to copy.
The drive letter assigned to the USB stick does not need to be a part of the "myfolder1" name. See the other thread the m2 linked to.
Run the script once to add your folders to the host machine. Run it a second time to delete them.

Untested but should work.

Ed

gjjh25
Offline
Last seen: 1 month 2 weeks ago
Joined: 2006-04-03 07:38
thank you for thi i will try

thank you for this i will try it out

Graham Yates

gjjh25
Offline
Last seen: 1 month 2 weeks ago
Joined: 2006-04-03 07:38
tried this, this morning, it

tried this, this morning, it copies the my setups folder ok, but i cant get it copy any folders over?

Graham Yates

gjjh25
Offline
Last seen: 1 month 2 weeks ago
Joined: 2006-04-03 07:38
probablyy hardcoded. still

probablyy hardcoded.

still strugglinto get this to work, if anyone has any further ideas

Graham Yates

Log in or register to post comments