jana
asked on
How to run a batch file successfully in the user Startup Folder.
We want to have a batch file open when the user logs on every time. The batch file has a shortcut to it with admin rights and the shortcut is copied at the startp folder (that is "C:\Users\username\AppData \Roaming\M icrosoft\W indows\Sta rt Menu\Programs\Startup"). Yet, when the PC restart or re-log in, it don't start, all other apps in the startup folder runs, but not the batch file.
Please advice.
Please advice.
ASKER
will try
ASKER
Didn't work. Just doesn't display.
So strange.
I have text files, other apps in the user startup folder not the windows, and all of them start - the batch file doesn't.
What else can it be?
So strange.
I have text files, other apps in the user startup folder not the windows, and all of them start - the batch file doesn't.
What else can it be?
ASKER
Placed "paused" statement to see if it passes through this batch file, and nothing; it just goes thru.
ASKER
Did noticed that the batch file is not in the Startup folder of Task manager, everything else except the batch file....
please advice
please advice
Place the batch file in particular location and use run registry to that
ASKER
What do you mean by "... and use run registry to that"?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Understood, will try.
ASKER
Thank you! Just tried it and it works!
Why placing the shortcut in windows startup doesn't work?
Why placing the shortcut in windows startup doesn't work?
you Must be aware that some program needs Administrative privilege to start. Keeping program simply in startup folder doesn't provide the program permission to execute it.
You either need to remove the Option to run program as administrator.
You either need to remove the Option to run program as administrator.
ASKER
Yes it has the admin privileges.
ASKER
It's ok... u already helped me getting on automatic at every startup.
Thanx
(we'll figure out)
Thanx
(we'll figure out)
That is not a solution.
Scripts in HKEY_LOCAL_MACHINE\SOFTWAR E\Microsof t\Windows\ CurrentVer sion\Run do not run elevated.
Solution: create a scheduled task - David told you and you tried. Of course, it does not display when run with different credentials and elevated - that is normal. But the executable or script does run elevated ("with administrative permissions").
Scripts in HKEY_LOCAL_MACHINE\SOFTWAR
Solution: create a scheduled task - David told you and you tried. Of course, it does not display when run with different credentials and elevated - that is normal. But the executable or script does run elevated ("with administrative permissions").
ASKER
the shortcut has been elevated with the privileged run as admin, but didn't work. The registry has been working (would've preferred just placing the shortcut in startup or schedule, but no luck - with batch files - all else do work in startup)
Rayluvs, there is something strange. That registry location does not elevate, sorry, so unless your UAC is off and at the same time The user is administrator, it cannot possibly do system changes elevated.
ASKER
Yes the user is admin.
And UAC? Off or on?
or
use task scheduler to run the batch file on user login with highest privileges