Login | |
|
 |
RE: create quick scheduled task - 12/6/2005 9:15:05 AM
|
|
 |
|
| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
just a note, youll have to run this with cscript (you do have that set as your default scripting host right?)
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|
| |
|
|
|
 |
RE: create quick scheduled task - 12/7/2005 5:05:05 AM
|
|
 |
|
| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
one of my co-workers, even after suggesting he should (a few times...) so i sent him a script that iterated all the files on his file system (gotta love wmi!!) needless to say, he didnt think to just kill the process... (not that i havent ever done this to myself lol) yes im evil, but im ok with it another note on the script above, the path to the executable cant have any spaces in it
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|
| |
|
|
|
 |
RE: create quick scheduled task - 7/4/2007 11:24:46 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
you cant just type sysroot and expect the computer to know what you want. If you type sysroot in Start run you will also get an error. You will need to do somthing like this Dim WshEnv : Set WshEnv = WshShell.Environment("Process") SysRoot = WshEnv("%SystemRoot%") If not fso.fileExists(SysRoot & "\Tasks\date.job") then
|
|
| |
|
|
|
 |
RE: create quick scheduled task - 7/5/2007 11:17:33 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
I have used the following in the past Set WshShell = CreateObject("WScript.Shell") Set WshEnv = WshShell.Environment("Process") SysDrive = WshEnv("SYSTEMDRIVE") SysRoot = WshEnv("SYSTEMROOT") SysUsers = WshEnv("USERNAME") LogonSvr = WshEnv("LOGONSERVER") Would this be correct based on your first example below I see this method does not set WshShell.Environment("Process") is that the only difference Set WshShell = CreateObject("Wscript.Shell") SysRoot = WshShell.ExpandEnvironmentStrings("%SYSTEMROOT%") SysDrive = WshShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") SysUsers = WshShell.ExpandEnvironmentStrings("%USERNAME%") LogonSvr = WshShell.ExpandEnvironmentStrings("%LOGONSERVER%")
|
|
| |
|
|
|
 |
RE: create quick scheduled task - 7/6/2007 12:27:36 AM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
If you still want the inputbox then use the code below, personally I would create the script with the password in it and just encode the script to vbe, my users have no clue what scripts are anyway or where to find them Password = InputBox ("Please enter your password:")
|
|
| |
|
|
|
 |
RE: create quick scheduled task - 7/11/2007 2:53:32 PM
|
|
 |
|
| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
sorry i havent been on the board much to help, thanks for helping guys
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|
| |
|
|
|
|
|