Solved

Run a Bat file as Administrator when I log in

Posted on 2013-06-02
8
551 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unable install Internet Explorer 11 on Windows 7 pro sp1 21 97
sysprep and capture task sequence enables admin account 16 41
SQL Server error 26 103
Windows 7 won't join domain 4 42
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
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 how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

910 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

18 Experts available now in Live!

Get 1:1 Help Now