Run a process later

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I need to run an inventory task on every PC in my network (W2K and XP). I
don't want to slow down the opening of the Windows session , so I tried to
use the "soon" command in my login script to run the process 120 seconds
later. Well, this works ... only if the user if member of the admin group (or
maybe power user), because "soon" relies on the "at" command,which is
reserved to administrators.
I thought of using the "sleep" command, but I don't like having a commmand
window in the task bar that can be seen by users.
Does anyone know how I could delay my process without any administrative
rights ?
 
Execute the inventory task with a VBScript.
There will be no open window.
Copy and paste this into a text editor (i.e. Notepad)


Option Explicit
Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 120000
objShell.Run """C:\Program Files\Example\ProgramName.exe"""
Set objShell = Nothing


Line 4: Time is in milliseconds. 1 second = 1000 ms, so 120 seconds = 120000 ms.
Change the path and program name on line 5: C:\Program Files\Example\ProgramName.exe
Save the file with any name and use vbs for the extension. (LaunchInventory.vbs)
Start the VBScript with your logon script.


Austin M. Horst
 
Thanks for your answer,

Well, this doesn't really solve my problem. The users have a logon script (a
..bat file executed from the Netlogon share). If I run the .vbs by issuing a
"start cscript.exe ..." command, it opens a command window ! And if I just
write "cscript.exe ...", then the logon script waits until the script has
finished running.
I'm just thinking that I could also run the script from a logon GPO, but I
am afraid this would also prevent the Windows session from immediately
opening.

If you have any more information ...
 
Put the .vbs file in the Netlogon share.
Do not use "START" or "CSCRIPT.EXE"
Put the name of the script on a line by itself in your batch file.
LAUNCHINVENTORY.VBS


Austin M. Horst
 
Well ...

Maybe I miss something, but I still get the same result : the logon script
executes (it runs a couple of "net use" commands), and when it comes to the
..vbs ... it waits for the 120 seconds (leaving the command window open)
before executing the rest of the .bat.
 
guru said:
Well ...

Maybe I miss something, but I still get the same result : the
logon script executes (it runs a couple of "net use" commands),
and when it comes to the .vbs ... it waits for the 120 seconds
(leaving the command window open) before executing the rest of
the .bat.
Hi,

See if using start and wscript (not cscript) works better:

start wscript.exe launchinventory.vbs
 
Back
Top