#1 01 May 2018 06:26

New Member
Registered: 01 May 2018
Posts: 1

xcopy folder name with variables

I need to update several subdirectories of a server, I can not add a x in the name of a folder path.

Example :

xcopy "%~dp0fsaua-reset.exe" "\SRV-MDT\DeployShare\Applications\* - F-Secure Computer Protection\" /Q /I /E /Y

xcopy "%~dp0FsUninstallationTool.exe" "\SRV-MDT\DeployShare\Applications\* - F-Secure Computer Protection\" /Q /I /E /Y

"*" = variable of folder name

Dont work, please help me !


#2 08 May 2018 16:04

From: Minnesota
Registered: 18 Feb 2010
Posts: 346

Re: xcopy folder name with variables

Can you show the whole script... or at least the entire FOR loop?
Remember that variables are typically expanded at 'Load Time'. So if you are setting and interrogating a variable in a FOR loop or in a parenthesized block you will need to take that into consideration. Delayed Expansion is one way to do that.

Windows Shell Scripting and InstallShield


Board footer

Powered by FluxBB