Solved

Run a Bat file as Administrator when I log in

Posted on 2013-06-02
8
556 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 40

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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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 54

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 54

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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

One of the features I've come to appreciate about Windows 7 and Windows Server 2008 R2 is the ability to pin applications to the task bar. As useful a feature as I've found this, it does have some quirks.  For example, have you ever tried pinning an…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

749 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