?
Solved

Run a Bat file as Administrator when I log in

Posted on 2013-06-02
8
Medium Priority
?
559 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 
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 56

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 56

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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

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…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
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 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

762 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