How do I make my program run with different privileges at Windows 7 startup?

There is a COM component called TaskScheduler. Some documentation is at msdn.microsoft.com/en-us/library/aa38400...).aspx An example in C# is included in the Windows 7 Training Kit.

There is a COM component called TaskScheduler. Some documentation is at msdn.microsoft.com/en-us/library/aa38400...).aspx. An example in C# is included in the Windows 7 Training Kit.

JCL provides a Delphi interface unit to control Microsoft task schedule service. Its name is JclTask.pas. They also provide a demo application for adding/removing/showing Windows tasks in "jcl\examples\windows\tasks" folder.

Also, if commercial components are OK with you, SiComponents provides VCL Scheduling Agent, which is a VCL wrapper for Windows Task Scheduler, and supports new interface provided in Windows Vista.

See the command line options for schtasks. Exe at MSDN for options. Your command line might look something like this: schtasks.

Exe /Create /RU {username} /RP {password} /SC ONLOGON /TN {task name} /TR {file to run} /RL HIGHEST. The "/RL HIGHEST" is what lets the task run with the admin level privileges.

Probably the easiest way, even the code not based on Delphi but I'll try in the early morning. – user258126 May 4 '10 at 16:17 I guess I can't use schtasks. Exe because my program have to fill username and password, if required.

– user258126 May 5 '10 at 2:19 Yes - SOME security is needed to be able to run at an elevated permissions level. If no security was required, I guess any program - virus, trojan, logger - could easily add a task to elevate itself. Something from the user is required; either a dialog acknowledgement or the input of extra information.

– Jason Swager May 5 '10 at 15:26.

I want to get my app to start at Windows 7 startup. My program has an embedded UAC manifest – user258126 May 4 '10 at 16:05 It looks like some one took the liberty of changing the title of your question. I recently went through the exercise of getting the "start app at windows startup" to work on Vista after it had been working successfully on XP for a long time.

On XP my app would write a key to the Registry but this was crashing Vista. So rethinking this, I now think the best way to go is not to write to the Registry but instead to programmaticly create a "Shortcut" and write it into the Startup "Directory". This works for all versions of windows.

If your interested, I'll post the code. – user327359 May 4 '10 at 18:04 1 IIRC windows startup blocks startup apps that require elevation because it would annoy the user with prompts. – Larry Osterman 06/08 at 18:46 I've tried to create shortcut and it doesn't work at Windows 7.

Why this simple thing become sophicasted problem at Windows 7 :) . I guess I am gonna look JCL, even my prediction is JCL use "at. Exe" instead of "schtasks.

Exe" – user258126 May 5 '10 at 2:28 1 iira: See this blog post: blogs.msdn. Com/uac/archive/2006/08/23/715265. Aspx What you're trying to do is explicitly not supported because it would annoy users.

– Larry Osterman 06/08 at 23:40.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions