Re: VBScript added to Scheduled Task
- From: jgarringer@xxxxxxxxx
- Date: 1 Sep 2006 20:48:16 -0700
Hi neualex,
A quick change and you'll be good to go! Try this:
Dim wshShell, s
Set wshShell = CreateObject("Wscript.Shell")
s = "notepad"
wshShell.Run s,1,True
Notice the 1 in the run command instead of the 0. This is the window
type parameter. A 0 in this parameter runs the program but hides the
window. A 1 activates the window and displays it. There are other
window type parameter options which you can review at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/6f28899c-d653-4555-8a59-49640b0e32ea.asp
Hope this helps.
James Garringer
neualex wrote:
Hi guys
I created a very simple vbscript that runs notepad:
Dim WshShell, oExec, s
set WshShell = CreateObject("WScript.Shell")
s= "cmd /c notepad "
oExec = WshShell.run(s,0,True)
set WshShell = nothing
This script is added to the Schedule Task in Windows 2000.
The task is run with an admin user.
The problem is that the task seems to be run, but I don't see the notepad.
If I go to the taskmgr I can see the notepad in the list, but it doesn't pop
up visually.
Did anything like that happen to you guys?
Thank you.
.
- Follow-Ups:
- Re: VBScript added to Scheduled Task
- From: Joe Bruns
- Re: VBScript added to Scheduled Task
- Prev by Date: Re: Parameters are null from VBS client
- Next by Date: Re: Can't change service logon information
- Previous by thread: Re: disable keyboard and mouse while running script
- Next by thread: Re: VBScript added to Scheduled Task
- Index(es):
Relevant Pages
|