[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Run a Bat file as Administrator when I log in

Posted on 2013-06-02
8
Medium Priority
?
564 Views
Last Modified: 2013-06-06
I have a bat file on my desktop in a Win7 Home Premium 64-bit OS.  Every time I log in I right click this file and run it as Administrator.  I'd like to know how I can set it up to run automatically when I log in.  It does need to run as the Admin.

Thanks in advance.
0
Comment
Question by:RichNH
8 Comments
 
LVL 24

Expert Comment

by:aadih
ID: 39215224
Put a shortcut to the file in startup folder.  Also right click the shortcut -> properties -> compatibility tab -> check "run this program as an administrator."

If you need help about startup folder, look here:

http://www.sevenforums.com/tutorials/1401-startup-programs-change.html >
0
 
LVL 41

Accepted Solution

by:
footech earned 2000 total points
ID: 39215369
You can create a scheduled task.  Set the trigger to begin the task at log on (you can specify for all users or a specific one).  Select to run with highest privileges.
0
 
LVL 10

Expert Comment

by:Sam Simon Nasser
ID: 39215391
do the following:
go to start - run and type gpedit.msc
go to user configuration - windows settings - scripts (logon / logoff) - logon - add, and browse to your .BAT file and click ok.

now whenever a user logs in, the scripts will run automatically.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:jerseysam
ID: 39215526
Right-click batch file, properties, compatibility, change settings for all users. T

Tick run as admin box.

Move batch file to windows startup in All Programs
0
 
LVL 57

Expert Comment

by:McKnife
ID: 39219721
The scheduled task solution is the best because it elevates automatically.
0
 
LVL 1

Author Comment

by:RichNH
ID: 39224218
Well, I tried setting the batch file and the shortcut file to run as Admin while in the properties>CompatabilityMode, but the checkbox that would allow me to do that was not active so I couldn't.  I tried to move a copy of the shortcut to the bat file to the Startup folderand was told that that folder is off limits.   Strange since my account is an Administrator account and also strange since I also tried to do it in the Administrator account.  I thought Admin privs meant access to everything.  

Next I'll look into how to create a scheduled task.  You guys gotta realize, I'm pretty ignorant about Windows operating systems so be patient.  :-)
0
 
LVL 57

Expert Comment

by:McKnife
ID: 39224818
0
 
LVL 1

Author Closing Comment

by:RichNH
ID: 39227719
Thanks for the suggestion, it works like a charm.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Assume you have an outside contractor who comes in seasonally or once a week to do some work in your office, but you only want to give him access to the programs and files he needs and keep all other documents and programs private. Can you do this o…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question