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\Microsoft\Windows\Start 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.
rayluvsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
put the batch file in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
or
use task scheduler to run the batch file on user login with highest privileges
0
rayluvsAuthor Commented:
will try
0
rayluvsAuthor Commented:
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?
0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

rayluvsAuthor Commented:
Placed "paused" statement to see if it passes through this batch file, and nothing; it just goes thru.
0
rayluvsAuthor Commented:
Did noticed that the batch file is not in the Startup folder of Task manager, everything else except the batch file....

please advice
0
aravind ancheWindows/Vmware Commented:
Place the  batch file in particular location and use run registry to that
0
rayluvsAuthor Commented:
What do you mean by "... and use run registry to that"?
0
aravind ancheWindows/Vmware Commented:
For example
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Proxy"="C:\\Windows\\System32\\proxy.cmd"
if you have batchfile called proxy place that in a location, In example here I placed in C:\\Windows\\System32\\proxy.cmd place that in run registry, It run everytime the system starts
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rayluvsAuthor Commented:
Understood, will try.
0
rayluvsAuthor Commented:
Thank you!  Just tried it and it works!

Why placing the shortcut in windows startup doesn't work?
0
aravind ancheWindows/Vmware Commented:
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.
0
rayluvsAuthor Commented:
Yes it has the admin privileges.
0
rayluvsAuthor Commented:
It's ok... u already helped me getting on automatic at every startup.

Thanx
(we'll figure out)
0
McKnifeCommented:
That is not a solution.
Scripts in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\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").
0
rayluvsAuthor Commented:
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)
0
McKnifeCommented:
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.
0
rayluvsAuthor Commented:
Yes the user is admin.
0
McKnifeCommented:
And UAC? Off or on?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.