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)
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.
|
|
|
|
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)
Search the forum or read the documentation for the ExpandEnvironmentStrings method of the WScript.Shell object.
|
|
|
|
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)
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
|
|
|
|