Hi, I have the below command needs to be set in the StubPath. It worked fine in DOS, but does not work in StubPath key. I tried to change %appdata% to hardcoded path and it worked. Can anyone please tell me how should I variablise %appdata%? Thanks.

xcopy C:\Atlas\GlobeSoftware %appdata%\GlobeSoftware\ /e /c /y

 

Answer Summary:
cmd /c "xcopy %SystemDrive%\Atlas\GlobeSoftware %AppData%\GlobeSoftware\ /e /c /y"
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

3

StubPath value should be like this

cmd /c "xcopy C:\Atlas\GlobeSoftware %AppData%\GlobeSoftware\ /e /c /y"

Answered 07/19/2012 by: jagadeish
Red Belt

  • You can use %SystemDrive% in place of C:
    like
    cmd /c "xcopy %SystemDrive%\Atlas\GlobeSoftware %AppData%\GlobeSoftware\ /e /c /y"
  • APPDATA=C:\Users\[CurrentlyLoggedInUser]\AppData\Roaming
    in Windows 7
Please log in to comment

Answers

1

try to create a StubPath value as REG_EXPAND_SZ (by default will be set to  REG_SZ). 

Answered 07/19/2012 by: krulik
Senior Yellow Belt

Please log in to comment
1

Thanks for everyone's help especially jagadeish. Simply adding cmd /c in front of the command worked. I really like this forum because I can find so many warmhearted people with similar interest. Thanks again!

Answered 07/22/2012 by: nbafifa02
Senior Yellow Belt

Please log in to comment
0

I have too faced this issue before. Somehow I think Windows/CMD does not resolve the username properly through this. I may be wrong. I have even tried using a Powershell Script and it too does not work. The only thing which works perfectly fine is a VBScript.

Create a VBScript to copy this file and call VBScript in StubPath. I assure you it will work fine.

Take the script from here:

http://msiworld.blogspot.com.au/2012/04/script-to-copy-file.html

Answered 07/19/2012 by: piyushnasa
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share