Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Admin rights for batch

16 Aug 2010   #1
MPREv

Windows 7
 
 
Admin rights for batch

I got a batch script which needs Admin privileges.
For example it installs some Programmes or move/copy files to/from System directories.

So on Windows 7 (and Vista) I can say "Run as" and I got a Message like "are you sure allowing ... bla" OK/Cancel?
But how I can get arround this MSG-Box?
How can I place the Admin Name/PW in the Batchfile? (a runas cmd i allready tried seems to don't work)


My System SpecsSystem Spec
.
16 Aug 2010   #2
osholt

Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
 
 

As far as I am aware you are asking the impossible., or at least the stupendously difficult

You can however turn off UAC prompts completely so you just have to do Run as Administrator and it's done.

Another neat trick is start a program from within an elevated program (such as a dock); all programs opened using an elevated program themselves are automatically elevated .

Oli
My System SpecsSystem Spec
16 Aug 2010   #3
Thorsen

Win7 Home Premium 64x
 
 

Crtl+Shift+Mouse Click will launch the app with admin priveledges.

Otherwise, you can make a shortcut to the .bat file that has admin priveledges through this tut:

Elevated Program Shortcut without UAC Prompt - Create
My System SpecsSystem Spec
.

16 Aug 2010   #4
StuberB

MAC OS X v10.4.10
 
 

I have an idea. I am not sure if this would work with batch file or if you would even want to do this? You might be able to set it up so the user would take ownership of the batch. Once the user 'takes ownership' then they won't get the prompt to enter admin/pw. Let me know if you need details on how to do this and I will provide them for you.
My System SpecsSystem Spec
16 Aug 2010   #5
osholt

Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
 
 

Quote   Quote: Originally Posted by StuberB View Post
I have an idea. I am not sure if this would work with batch file or if you would even want to do this? You might be able to set it up so the user would take ownership of the batch. Once the user 'takes ownership' then they won't get the prompt to enter admin/pw. Let me know if you need details on how to do this and I will provide them for you.
Please correct me if I am wrong but I believe you are confusing two different things.

Permissions &

Elevated verification (UAC, it's a security feature).

He already owns the file, Windows is just insisting that to run it as an Administrator you have to go through a UAC prompt.

Since Vista all normal command prompt Windows have been with normal user privileges only unless you specify to open it as an Admin (yet another security feature).

I hope this clears things up, and if I've got anything wrong please correct me .

Oli
My System SpecsSystem Spec
16 Aug 2010   #6
StuberB

MAC OS X v10.4.10
 
 

I re-read the orginial problem and went through Thorsen solution and I agree this is what is needed to prevent UAC prompt for admin rights . . . I was suggesting a solution for a different problem. . . you are correct osholt
My System SpecsSystem Spec
16 Aug 2010   #7
osholt

Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
 
 

Quote   Quote: Originally Posted by StuberB View Post
I re-read the orginial problem and went through Thorsen solution and I agree this is what is needed to prevent UAC prompt for admin rights . . . I was suggesting a solution for a different problem. . . you are correct osholt
Don't worry, we all make mistakes. As long as you learn from them it's fine .

Have a nice day/night.

Oli
My System SpecsSystem Spec
Reply

 Admin rights for batch




Thread Tools




Similar help and support threads
Thread Forum
Remove Admin Rights and Move instead of Copy | Batch file
I have a list of 1000 files names that I put in a text file named list.txt. Need to find them in more folders, sub folders which has 12000+ files in it. The below script works fine but I would like the Admin Right to be removed and also I want the files to be moved permanently into C:\your_files....
General Discussion
"Unable to elevate to admin rights" error, when admin user
I am trying to download Adobe Digital Editions and I keep receiving the error message Unable to elevate to administrative rights, error 786 I am the admin! I have turned off the password, I have right clicked on the program and chosen 'run as admin'-then nothing happens. Any help would be...
Software
admin user lost some admin rights
I can't delete a file from the desktop. When I try, it says to get the rights from the specified admin user (which I'm logged on). The strange thing is that I still can create other users from this account (including admins). Any suggestion on what to do?
BSOD Help and Support
No admin rights
HI everyone , Just want to say i enabled the hidden administrator account in windows 7 from the command prompt and i was trying to install dreamscene, but still it gives me you have no admin rights...what to do? ALso theres another problem....a software CVAVR...when iwas installing it , got...
General Discussion
Admin rights
Ok, im in a massive pickle at the moment... I followed a tutorial on this site, allowing me to skip windows logon and go straight to the PC. I setup "netplwiz" and unchecked the "users need to ptu in a password," i restarted the system to see if it was working, and i got a BSOD. I restarted...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:07.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App