Solved

Run a Bat file as Administrator when I log in

Posted on 2013-06-02
8
550 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 39

Accepted Solution

by:
footech earned 500 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 53

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 53

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Image capture and Deploy method is consist on two phases. In our first phase we capture the image of windows from the PC in which Windows and others softwares are already installed. In second phase we deploy the created image on new PC in which we…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now