VMware Horizon Community
5zx555555
Contributor
Contributor

Hot to copy folder to \%AppData%\ using script.

Hello,
i am using thinapped MS Office 2010 (outlook 2010) on Windows 7 VDI's linked clones. Everything is working fine. I want to run script that copy one folder

(and files in this folder) to different location. I have preconfigured outlook signatures in one folder. I am using this script:

set source=C:\outlooksignatures
set destination=C:\Users\%username%\AppData\Roaming\Thinstall\MS_Outlook_2010\%AppData%\Microsoft\Signatures
xcopy %source% %destination% /y

If i type this script using cmd it shows me: invalid path 0 file(s) copied.

How can i copy "C:\outlooksignatures" folder? I can not get inside ....\Microsoft\Signatures folder then i try to copy C:\Users\

%username%\AppData\Roaming\Thinstall\MS_Outlook_2010\%AppData%\Microsoft\Signatures   If i just go just step by step clicking C:\ then

users... etc. i can get inside this folder ...\%AppData%\Microsoft\Signatures, but then i try to go directly through explorer to this

folder just copy/paste all path at one time i can not get inside. It shows address bar error message: windows cannot find 'C:\Users

\someusername\AppData\Roaming\Thinstall\MS_Outlook_2010\C:\Users\someusername\Appdata\Ro...\Signatures  I can see that there is some

kind of problem in this folder syntaxis (marked in bold). Then copy/paste all adress at one time %AppData% messes everything. But i don't know how to get directly to lowest

folder, not just by clicking folders inside step by step.

Reply
0 Kudos
1 Reply
oliAH
Enthusiast
Enthusiast

You need to escape the percent character for AppData folder otherwise it will be translated to %USERPROFILE%\AppData\Roaming.

Change your destination var to this:

set destination=C:\Users\%username%\AppData\Roaming\Thinstall\MS_Outlook_2010\%%AppData%%\Microsoft\Signatures

Or easier:

set destination=%APPDATA%\Thinstall\MS_Outlook_2010\%%AppData%%\Microsoft\Signatures

Please note ThinApp comes with scripting possibilites (VBS). Check these resources:

ThinApp Script Template | VMware ThinApp Blog - VMware Blogs

VMware KB: Using .vbs scripts for file operations on the sandbox and host filesystem

Blog: http://oliah.net >> Twitter: @olivier_ahson
Reply
0 Kudos