Page 1 of 1 1
Topic Options
#515 - 1999-09-27 09:49 AM Starting Schedule
JohnC Offline
Lurker

Registered: 2003-10-07
Posts: 0
I need to check if schedule is running from a script, so I need something like a registry entry. The above script changes the startup value to automatic, but I carn't find the registry value to change the current hardware profile to ENABLE.

$value = ReadValue ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule", "Start")
if $value = "2"
$txt = "Schedule running" gosub TEXT
run "cmd /c at /delete /yes"
run "cmd /c at 20:00 %windir%\shtdwn.exe /2"
else
$txt = "Setting schedule to run " gosub TEXT
writevalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule","Start","2","REG_DWORD")
gosub err
endif

Any ideas??
Thanks
John Carr


Top
#516 - 1999-09-28 06:04 AM Re: Starting Schedule
PaulMoxey Offline
Getting the hang of it

Registered: 1999-07-22
Posts: 90
Loc: Villawood, NSW, Australia
How about

run "cmd /c net start schedule"

??

------------------
Paul Moxey
POS & Senior Network Administrator
Taubmans Pty Ltd
Paul_Moxey@taubmans.com.au

_________________________
Paul Moxey POS & Senior Network Administrator BarloworldCoatings (AUST) Pty Ltd

Top
#517 - 1999-09-29 04:54 AM Re: Starting Schedule
Anonymous
Unregistered


I only need to start the service if it isn't running, do you know how to put the output string from "cmd /c at" into a variable so the status can be checked??

$value = " ??????????? "
if $value = "The service has not been started"
? "Starting Schedule service"
run "cmd /c net start schedule"
endif

run "cmd /c at /delete /yes"
run "cmd /c at 20:00 %windir%\shtdwn.exe /2"

Thanks
John Carr



Top
#518 - 1999-09-30 08:59 AM Re: Starting Schedule
PaulMoxey Offline
Getting the hang of it

Registered: 1999-07-22
Posts: 90
Loc: Villawood, NSW, Australia
It's a bit long winded, but

run "cmd /c at > %windir\temp\atstat.txt"
then open %windir\temp\atstat.txt for reading and see what the first (and only) line says and go from there.

A registry key with current service status would be much nicer, but I can't find one for the life of me!

------------------
Paul Moxey
POS & Senior Network Administrator
Taubmans Pty Ltd
Paul_Moxey@taubmans.com.au

_________________________
Paul Moxey POS & Senior Network Administrator BarloworldCoatings (AUST) Pty Ltd

Top
#519 - 1999-10-01 12:54 AM Re: Starting Schedule
Anonymous
Unregistered


You might find playing with: srvinfo.exe from the Windows NT resource kit useful. It lists all the services and their status for the computer specified.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1124 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.057 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org