Login | |
|
 |
RE: how to make this script to copy the file to "%... - 4/27/2006 6:30:20 AM
|
|
 |
|
| |
ebgreen
Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
|
Try: Const FOF_CREATEPROGRESSDLG = &H0& Dim oWsh:Set oWsh = CreateObject("WScript.Shell") ParentFolder = oWsh.ExpandEnvironmentStrings("%ProgramFiles%") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.NameSpace(ParentFolder) objFolder.CopyHere "C:\Scripts", FOF_CREATEPROGRESSDLG
_____________________________
"... 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
|
|
| |
|
|
|
 |
RE: how to make this script to copy the file to "%... - 5/1/2006 1:25:54 AM
|
|
 |
|
| |
ebgreen
Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
|
Do the whole process twice. Not just the environment expansion. Dim oWsh:Set oWsh = CreateObject("WScript.Shell") ParentFolder = oWsh.ExpandEnvironmentStrings("%ProgramFiles%") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.NameSpace(ParentFolder) objFolder.CopyHere "C:\Scripts", FOF_CREATEPROGRESSDLG ParentFolder = oWsh.ExpandEnvironmentStrings("%windir%") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.NameSpace(ParentFolder) objFolder.CopyHere "C:\Scripts", FOF_CREATEPROGRESSDLG
_____________________________
"... 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
|
|
| |
|
|
|
 |
RE: how to make this script to copy the file to "%... - 5/1/2006 4:19:07 AM
|
|
 |
|
| |
ebgreen
Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
|
Well, if you had a lot of directories, then you could put the list of directories into an array and iterate through the array doing the code for each directory but that is overkill for two directories and three lines of repeated code.
_____________________________
"... 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
|
|
| |
|
|
|
|
|