简体   繁体   中英

Delphi XE 5 Application Not Starting up from startup Directory Windows 8.1

I am trying to get my application to start at startup. So far i have tested it on windows xp and windows 7 and it works like a charm. But in windows 8.1 the shortcut is in the startup directory C:\\Users\\Administrator\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup but it does not start.

If i check with the task manager under the start up tab the application is there and is enabled. But it just doesn't start on start up.

Can anybody please assist?

Update 1:

I have found the problem. I marked the application to run as administrator. When i removed that privileges the application started at start up. Why would this interfere? i ran it as administrator in windows 7. and since have tested it on windows 8 and also had to set it to run as administrator, even then it worked. Only in 8.1 did it cause the software not to start up.

Does anybody know why?

UPDATE 2:

OK to be clearer on the above mentioned update. and comments.

The program works fine. Nothing is wrong with it. When it is checked to run as administrator it does not auto start. When the admin rights are removed. It does auto start.

I have done a simple test to see if the software even launches and it does not so logging wont help. I set a message to appear if the application launches so before anything is processed i get notified. Before there can be any errors in code it will tell me.

SO the problem is not the coding in the program. The problem clearly is windows 8.1 which does not let my application auto launch on start up when it has admin rights.

It transpires that the issue is that you wish the program to run elevated which results in a UAC dialog being shown. Windows blocks autostart programs that requested elevation. You report a difference between Windows 7 and Windows 8 but I suspect that the real difference is your UAC settings on the two machines.

This is discussed in more detail in these links:

In all cases, the recommendation is to use the task scheduler to cache admin credentials and so avoid facing the UAC dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM