6

I placed a shortcut to a program (with one parameter) in the startup folder. That program does not get started up upon Windows startup. The shortcut's target is something like:

"C:\Program Files (x86)\MyProgram\MyProgram.exe" -param

And the "Start in" is

"C:\Program Files (x86)\MyProgram\"

The program, when executed, would be run as Administrator.

Does anyone know what went wrong and how I could "debug" this?

2
  • Where exactly on the disk have you put your shortcut?
    – Nifle
    Oct 15, 2010 at 8:58
  • I made the shortcut for all users: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
    – William
    Oct 18, 2010 at 3:30

2 Answers 2

2

I had exactly the same problem, UAC blocks the program because it asks for administrator rights, but does not pop up the "Do you feel lucky" dialog because of the way the program was initiated.

Solution: Instead of a startup shortcut, schedule a task to run at log on.

Go to: Start -> Control Panel -> System and Security -> Administrative Tools -> Schedule tasks

Here you can create tasks that do all sorts of stuff given a variety of conditions. When you create a task to run programs with administrator privileges you need to tick a box labeled "Run with highest privileges" under General -> Security options in the Create Task dialog.

3
  • Thanks for the suggestino! One problem is that the shortcut was created by InstallAnywhere (an intallation packaging program), and i'm not sure it is capable to schedule a task...any other suggestions?
    – William
    Oct 29, 2010 at 3:12
  • You mean that you need to do this programmatically, and pack the solution in the installer for some program? It is certainly possible, here is a suggestion for reading material: msdn.microsoft.com/en-us/library/aa384138(VS.85).aspx Oct 29, 2010 at 20:47
  • I haven't actually tested the method, but it does sound reasonable. I might be able to write a script and execute it after the installation. Thanks!
    – William
    Nov 1, 2010 at 6:32
0

Have you tried clicking on the shortcut manually to see that it actually runs your program?

If it does not, you can then open a command prompt, change to the directory using cut/paste from the shortcut, and then cut/paste the command from the shortcut and hit enter.

That might give a clue as to what's happening.

1
  • Thanks for your reply. Yes, I have. The shortcut works fine: a UNC challenge would pop up and the program would start running after the challenge as been confirmed.
    – William
    Oct 15, 2010 at 6:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .