Seite 1 von 1

Copying a file with space in filename

Verfasst: 14 Aug 2014, 17:55
von realflash
Dear all,

In [Actions]:

Code: Alles auswählen

DefVar $Shortcut$
Set $Shortcut$ = "%ScriptPath%\" + "Triton Black.lnk"
In the subroutine:

Code: Alles auswählen

[Files_copy_sso]
Copy $Shortcut$ "C:\Users\Public\Desktop"
Output when running the script:

Code: Alles auswählen

Error:  Directory C:\Windows\system32\Black.lnk "C:\Users\Public\Desktop" does not exist and cannot be created
Clearly the Copy command has not handled the space in the variable. How can I solve this, please? Is there some escape character? I can't find any references to this scenario in winst reference.

Thanks for any help.

Ian Gibbs

Re: Copying a file with space in filename

Verfasst: 15 Aug 2014, 09:52
von trabs-ol
Hi,

have you tried:

Code: Alles auswählen

[Files_copy_sso]
Copy "$Shortcut$" "C:\Users\Public\Desktop"
Regards

Re: Copying a file with space in filename

Verfasst: 03 Sep 2014, 20:43
von realflash
I can confirm that this works. Upon reflection it is pretty obvious, so I apologise for being a bit dim. Thank you for your help.