Admin rights for batch

MPREv

New member
Member
VIP
Local time
8:36 AM
Messages
136
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 Computer

OS
Windows 7
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 Computer

Computer Manufacturer/Model Number
Apple MacBook 5,1
OS
Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
CPU
Intel Core 2 Duo 2.4Ghz
Memory
4GB DDR3
Graphics Card(s)
Nvidia 9400m
Monitor(s) Displays
13.3" Internal + 22" DVI + 21.5" USB
Screen Resolution
1280x800 + 1920x1080 + 1920x1080
Hard Drives
Internal SATA 2.5" 500GB (395GB Mac HFS+, 105GB Windows NTFS)
2.48TB RAID consisting of 5 disks (HFS+)
Case
Aluminium Unibody
Keyboard
Apple Late 2009 Wireless Keyboard (US)
Mouse
Apple Magic Mouse
Internet Speed
6.33Mb/s up. 0.36Mb/s down.
Other Info
Harman Kardon Soundsticks II Speakers

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ASUS G60-RBBX05
OS
Win7 Home Premium 64x
CPU
Intel Core 2 Duo P7450 / 2.13 GHz (2.29 with Extreme Turbo)
Memory
4 GB PC-6400 Hyundai (2X2) at 800Mhz
Graphics Card(s)
NVIDIA GeForce GTX 260M 1GB DDR3 VRAM
Monitor(s) Displays
16" LED Backlit
Screen Resolution
1366 x 768 on laptop 1600x1050 max res on 22" external mon
Hard Drives
OCZ Agility 3 60GB SSD / 320 GB - Serial ATA-150 - 7200 rpm
PSU
6-cell Lithium ion { lasts 1.5 hours }
Case
ASUS G60 Laptop
Keyboard
Chicklet type back-lit (white light) keyboard
Mouse
Logitech G9 Laser Mouse 3200dpi and 1000 reports per minute
Internet Speed
Comcast 8.60mb/s up - 3.11mb/s down
Antivirus
MSE
Browser
Firefox
Other Info
General mid-budget gaming Comp. Low batterylife - High FrameRates - currently overheating problems :(

2nd Rig: Case: Rosewill BLACKHAWK Gaming ATX Mid Tower Computer Case

Mobo: GIGABYTE GA-990FXA-UD3
CPU: AMD FX-6200 Zambezi 3.8GHz (4.1GHz Turbo)
Heatsink: COOLER MASTER V8 CPU Cooler
RAM: Patriot Viper 3 8GB (2 x 4GB) 240-Pin DDR3 SDRAM 1866 (PC3 15000)
GPU: SAPPHIRE Radeon HD 6850 1GB 2
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 Computer

Computer Manufacturer/Model Number
Mac Mini
OS
MAC OS X v10.4.10
CPU
2.4 Ghz
Motherboard
Intel Mini ITX iG45
Memory
2GB
Graphics Card(s)
NVIDIA GeForce 320M 256MB of DDR3 SD
Hard Drives
320GB
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 Computer

Computer Manufacturer/Model Number
Apple MacBook 5,1
OS
Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
CPU
Intel Core 2 Duo 2.4Ghz
Memory
4GB DDR3
Graphics Card(s)
Nvidia 9400m
Monitor(s) Displays
13.3" Internal + 22" DVI + 21.5" USB
Screen Resolution
1280x800 + 1920x1080 + 1920x1080
Hard Drives
Internal SATA 2.5" 500GB (395GB Mac HFS+, 105GB Windows NTFS)
2.48TB RAID consisting of 5 disks (HFS+)
Case
Aluminium Unibody
Keyboard
Apple Late 2009 Wireless Keyboard (US)
Mouse
Apple Magic Mouse
Internet Speed
6.33Mb/s up. 0.36Mb/s down.
Other Info
Harman Kardon Soundsticks II Speakers
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 Computer

Computer Manufacturer/Model Number
Mac Mini
OS
MAC OS X v10.4.10
CPU
2.4 Ghz
Motherboard
Intel Mini ITX iG45
Memory
2GB
Graphics Card(s)
NVIDIA GeForce 320M 256MB of DDR3 SD
Hard Drives
320GB
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 Computer

Computer Manufacturer/Model Number
Apple MacBook 5,1
OS
Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
CPU
Intel Core 2 Duo 2.4Ghz
Memory
4GB DDR3
Graphics Card(s)
Nvidia 9400m
Monitor(s) Displays
13.3" Internal + 22" DVI + 21.5" USB
Screen Resolution
1280x800 + 1920x1080 + 1920x1080
Hard Drives
Internal SATA 2.5" 500GB (395GB Mac HFS+, 105GB Windows NTFS)
2.48TB RAID consisting of 5 disks (HFS+)
Case
Aluminium Unibody
Keyboard
Apple Late 2009 Wireless Keyboard (US)
Mouse
Apple Magic Mouse
Internet Speed
6.33Mb/s up. 0.36Mb/s down.
Other Info
Harman Kardon Soundsticks II Speakers
Back
Top