Copying a file with space in filename

Antworten
realflash
Beiträge: 13
Registriert: 14 Aug 2014, 17:48

Copying a file with space in filename

Beitrag 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
trabs-ol
Beiträge: 64
Registriert: 07 Dez 2011, 10:46

Re: Copying a file with space in filename

Beitrag von trabs-ol »

Hi,

have you tried:

Code: Alles auswählen

[Files_copy_sso]
Copy "$Shortcut$" "C:\Users\Public\Desktop"
Regards
realflash
Beiträge: 13
Registriert: 14 Aug 2014, 17:48

Re: Copying a file with space in filename

Beitrag 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.
Antworten