help writing a script to copy .exe to startup

Rich Piano

Commendable
Mar 25, 2016
58
0
1,640
Hi there

can someone assist i am trying to create a batch that can copy a file from a server then place it in the users startup folder.
"\\server\folder\folder\folder\ICT\Shared Content\application.EXE" "%USERPROFILE%\Start Menu\Programs\Startup" that is what i have found so far on the net, i have not had any experience in creating scripts so please don't judge my lack of experience to much.

Thank you.
 
Solution
Hi, you're nearly there. There are a few methods for this but as it's just a straight forward copy of a single file, I'd use xcopy.

Type the following and save as .bat file.

xcopy "\\server\folder\folder\folder\ICT\Shared Content\application.EXE" "%USERPROFILE%\Start Menu\Programs\Startup"

I usually add pause at the end so the cmd window stays open when its finished running so I can see any errors

xcopy "\\server\folder\folder\folder\ICT\Shared Content\application.EXE" "%USERPROFILE%\Start Menu\Programs\Startup"
pause

There are various switches you can use for more complicated things. If you want to see what these are used for check out this Microsoft article...
Hi, you're nearly there. There are a few methods for this but as it's just a straight forward copy of a single file, I'd use xcopy.

Type the following and save as .bat file.

xcopy "\\server\folder\folder\folder\ICT\Shared Content\application.EXE" "%USERPROFILE%\Start Menu\Programs\Startup"

I usually add pause at the end so the cmd window stays open when its finished running so I can see any errors

xcopy "\\server\folder\folder\folder\ICT\Shared Content\application.EXE" "%USERPROFILE%\Start Menu\Programs\Startup"
pause

There are various switches you can use for more complicated things. If you want to see what these are used for check out this Microsoft article

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

 
Solution