/build/static/layout/Breadcrumb_cap_w.png

How to variablise %appdata% in StubPath key of Active Setup?

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

 


0 Comments   [ + ] Show comments

Answers (4)

Answer Summary:
cmd /c "xcopy %SystemDrive%\Atlas\GlobeSoftware %AppData%\GlobeSoftware\ /e /c /y"
Posted by: jagadeish 11 years ago
Red Belt
3

StubPath value should be like this

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


Comments:
  • You can use %SystemDrive% in place of C:
    like
    cmd /c "xcopy %SystemDrive%\Atlas\GlobeSoftware %AppData%\GlobeSoftware\ /e /c /y" - jagadeish 11 years ago
  • APPDATA=C:\Users\[CurrentlyLoggedInUser]\AppData\Roaming
    in Windows 7 - jagadeish 11 years ago
Posted by: krulik 11 years ago
Senior Yellow Belt
1

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

Posted by: nbafifa02 11 years ago
Senior Yellow Belt
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!

Posted by: piyushnasa 11 years ago
Red Belt
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

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ