[fpc-pascal]Windows ShutDown Privilege

memsom at interalpha.co.uk memsom at interalpha.co.uk
Mon Dec 9 11:12:28 CET 2002

> I'm using Windows 2000 SP3 and I compiled under both Delphi and fpc.
> The function is due to be used under Windows 95/98 and Win2000 so I'd
> like to get the privileges sorted so I can shut either OS down.

The code I sent was compiled under Delphi 5 with all updates (the service pack 
plus the ADO and stuff like that, not that I expect the ADO to make much 

The code has been run on both NT4 with SP6a (IIRC) or SP5, and a hokey Win2k 
which probably has no SP's at all, or at most SP1 (the site I'm on only just 
uses Win2k!! Some users are stull on NT4.)

I have local admin rights on my machine... I've never tried it on a machine 
that has no admin rights, but as you mention, I thought that wouldn't make a 
> I've tried under administrator but this has made no difference. I was
> under the impression that application privileges are independent of
> the user logged in at the time?

Ditto (as stated above.)

> I'll dig out an old copy of Delphi and compile it just to be sure
> there has been no change in the API functions, though I did
> double-check online with MSDN and all looked OK.

Delphi 5 would be a good one to try. I can send you the project if you would 
find that easier, but it should build as is. There were no extra files other 
than the body of source I posted.
> Again, many thanks for all the suggestions and help so far.

NP. If it does work in Delphi, it could be a quirk of FPC. Or even, shock 
horror, a bug ;-P Then again, it could just be user permissions. I've no easy 
way of testing. I could send you my exe if that helps.. that way you'd know if 
my version fails without having to dig out Delphi.


This message was sent using Mistral WebMail.

More information about the fpc-pascal mailing list