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?
New: DesktopSnowOK (Jan 6, 2025), Platform 29.5.3 (Jun 27, 2024)
1,100+ portable packages, 1.1 billion downloads
No Ads!, Please donate today
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
Will you supply the file names as arguments, or do you want them "hardcoded" into the batch file?
Vintage!
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
@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
thank you for this i will try it out
Graham Yates
tried this, this morning, it copies the my setups folder ok, but i cant get it copy any folders over?
Graham Yates
probablyy hardcoded.
still strugglinto get this to work, if anyone has any further ideas
Graham Yates