Copy to %USERPROFILE%\data\local

Author Message
ogeccut

  • Total Posts : 4
  • Scores: 0
  • Reward points : 0
  • Joined: 5/23/2007
  • Status: offline
Copy to %USERPROFILE%\data\local Thursday, December 08, 2011 3:47 AM (permalink)
0
I have a script that i can copy data to the local location.
However i need to copy data to %userprofile%\appdata folder
 
Const OverWriteFiles = TrueSet objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder "C:\DiskImages\AppData" , "c:\dest" , OverWriteFiles
 
if i try to change the script:
objFSO.CopyFolder "C:\DiskImages\AppData" , "%USERPROFILE%" , OverWriteFiles
i get no error but do not see my files in c:\users\%username%\appdata
If i try to open %USERPROFILE% from run window it resolves to c:\users\%username%
Thank you.

 
#1
    ebgreen

    • Total Posts : 8219
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    Re:Copy to %USERPROFILE%\data\local Thursday, December 08, 2011 4:11 AM (permalink)
    0
    Search the forum or read the documentation for the ExpandEnvironmentStrings method of the WScript.Shell object.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      winger.love

      • Total Posts : 5
      • Scores: 0
      • Reward points : 0
      • Joined: 12/7/2011
      • Status: offline
      Re:Copy to %USERPROFILE%\data\local Thursday, December 08, 2011 2:05 PM (permalink)
      0
      dim objshell,userfilefolder,fs
      const overwrite=true
      set objshell=createobject("wscript.shell")
      userfilefolder=objshell.expandEnvironmentStrings("%userprofile%")
      'msgbox userfilefolder
      set fs=createobject("scripting.filesystemobject")
      fs.copyfolder "C:\diskimages\appdata",userfilefolder&"\",overwrite
      set fs=nothing
      set objshell=nothing
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9