Hello,
I'm hoping someone can help me accomplish my goal - I want to create a vbs script to be run in group policy that copies a folder to the local machine, executes the program, allows enough time for the program to do it's thing, and then deletes it.
Can someone with more than my non-existent grasp of vbscript look what I have over and see if it'll work?
Perhaps best practice would be to chop it up into multiple scripts?
Piecing together various parts, I've created this Frankenstein of a vbscript:
Set FSO =CreateObject("scripting.FileSystemObject")
FSO.CopyFolder "\\SERVER\share", "c:\temp" ,True
MsgBox"BackUp completed, Goodbye", vbInformation, "Script Informer"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """C:\Temp\program.exe""",0,true
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
wscript.Sleep 30
dim filesys, demofolder
set filesys = CreateObject ("Scripting.FileSystemObject")
set demofolder = filesys.GetFolder("c:\temp\share")
demofolder.Delete
Thanks much,
-Drew
I'm hoping someone can help me accomplish my goal - I want to create a vbs script to be run in group policy that copies a folder to the local machine, executes the program, allows enough time for the program to do it's thing, and then deletes it.
Can someone with more than my non-existent grasp of vbscript look what I have over and see if it'll work?
Perhaps best practice would be to chop it up into multiple scripts?
Piecing together various parts, I've created this Frankenstein of a vbscript:
Set FSO =CreateObject("scripting.FileSystemObject")
FSO.CopyFolder "\\SERVER\share", "c:\temp" ,True
MsgBox"BackUp completed, Goodbye", vbInformation, "Script Informer"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """C:\Temp\program.exe""",0,true
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
wscript.Sleep 30
dim filesys, demofolder
set filesys = CreateObject ("Scripting.FileSystemObject")
set demofolder = filesys.GetFolder("c:\temp\share")
demofolder.Delete
Thanks much,
-Drew