script-shutdown when process ended

G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)

Hey, I was wondering if any of you knew how to write a script for XP,
that would probably run in system start-up, that will do a typical
shutdown -s automatically when a person ends a particular task. I have
seen quite a few commercial programs that do this for you but i would
like to make a simple script. Thanx...


--
suicidalslugsss
------------------------------------------------------------------------
suicidalslugsss's Profile: http://www.iamnotageek.com/member.php?userid=11282
View this thread: http://www.iamnotageek.com/showthread.php?t=1819055479
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)

--itsOver.vbs--
Bool = true
wscript.sleep 120000 'wait 2 minutes
while Bool
Running = false
wscript.sleep 10000 'wait 10 secs
for each Process in GetObject("winmgmts:").InstancesOf("Win32_Process")
if "notepad.exe" = Process.Name then
Running = true
end if
next
if not Running then
Bool = false
set shell=createobject("wscript.shell")
shell.run "shutdown -s"
end if
wend

--

Mark L. Ferguson (NOT an MS-MVP)
FAQ for MS Antispyware version 1.0.509
http://www.geocities.com/marfer_mvp/FAQ_MSantispy.htm
marfers notes for windows xp http://www.geocities.com/marfer_mvp/chatNotes.htm
..
"suicidalslugsss" <suicidalslugsss.1mqlj8@no-mx.forums.iamnotageek.com> wrote in message
news:suicidalslugsss.1mqlj8@no-mx.forums.iamnotageek.com...
>
> Hey, I was wondering if any of you knew how to write a script for XP,
> that would probably run in system start-up, that will do a typical
> shutdown -s automatically when a person ends a particular task. I have
> seen quite a few commercial programs that do this for you but i would
> like to make a simple script. Thanx...
>
>
> --
> suicidalslugsss
> ------------------------------------------------------------------------
> suicidalslugsss's Profile: http://www.iamnotageek.com/member.php?userid=11282
> View this thread: http://www.iamnotageek.com/showthread.php?t=1819055479
>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.help_and_support (More info?)

ok i made it using the script you wrote. I don't understand it all but
I'm assuming that notepad.exe was the target that is checked...but when
i ran it, the computer never shutdown and notepad wasn't
running....should i of added more to it or replaced parts you left for
me...does it have to be in the system start-up to work?....what is
"wscript.sleep 120000" for...so the computer doesn't shutdown before it
boots up?


--
suicidalslugsss
------------------------------------------------------------------------
suicidalslugsss's Profile: http://www.iamnotageek.com/member.php?userid=11282
View this thread: http://www.iamnotageek.com/showthread.php?t=1819055479
 

TRENDING THREADS