Link to home
Start Free TrialLog in
Avatar of snoopy_Spy
snoopy_Spy

asked on

Reboot, Detect, Run Service

Hi
I have 3 questions :
How can i reboot (Win9X, 2K, NT4)
How can i detect that the system was rebooted
Can i (and how) start a exe as service before i log on on a windows system !

For each question you get 25 points !
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of snoopy_Spy
snoopy_Spy

ASKER

Adjusted points from 25 to 75
For checking if windows was rebooted, i have heared that there is a possibility to copy a file and the file is copied when windows is booting !
Do you know how i can copy the file with this parameter ?
try using copyfile here:

if ok_to_close then
 begin
  copyfile(fromfile,tofile);
 Msg.Result := CAN_SHUTDOWN
end
else
 ..

The problem is, when i close the application and than shut down windows i doesn't know that !
hehe
of course not there is no way to now this if your app is not running ..
you caould make another small app that is hidden completely  and runing in background to check is windows shutdown.
when it gets message you can know then ..


hi
I have found it !
It's the MoveFileEx function ! The third parameter is the MOVEFILE_DELAY_UNTIL_REBOOT the file is moved when windows is rebooted !
ah very good ,i must remember that one ;-)