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: Batch file requests privileges

10 Aug 2011   #1
akhenax

Windows 7 32bit Enterprise
 
 
Batch file requests privileges

Greetings, I have a batch file created under the administrator account. The file is in the registry to "runonce". For a user with no password, the batch file runs fine. For a user with a password, the batch file requests the user's password that is logged on. Any idea why this happens? I would have expected the batch to run without needing the password of the user that is currently logged in.

The permissions are System and Administrators have full control, and users have 'Read and Execute' and 'Read'. The ID in question is a standard user. Thanks


My System SpecsSystem Spec
.
10 Aug 2011   #2
akhenax

Windows 7 32bit Enterprise
 
 

Update: I gave users 'Full Control' of the batch script, and the UAC still pops up requesting a password.
My System SpecsSystem Spec
10 Aug 2011   #3
Dwarf

Windows 8.1 Pro RTM x64
 
 

What is the batch file supposed to do?

The code you're using will prove helpful.
My System SpecsSystem Spec
.

10 Aug 2011   #4
akhenax

Windows 7 32bit Enterprise
 
 

it deletes a registry key in HKLU
My System SpecsSystem Spec
10 Aug 2011   #5
Dwarf

Windows 8.1 Pro RTM x64
 
 

You mean HKCU ?

Is it the same key for each user, and what is this key?

Does the batch file do anything else?
My System SpecsSystem Spec
10 Aug 2011   #6
akhenax

Windows 7 32bit Enterprise
 
 

Yes, HKCU, I always do that . I create the key in the administrator account, then Sysprep. Sysprep copies the profile, along with the registry key that points to a batch file to delete another registry key that gets created incorrectly during the profile copying. I know it seems a round about way to do this, but it works for the time being. The Regedit brings up the UAC for any account you login using a password.
My System SpecsSystem Spec
10 Aug 2011   #7
akhenax

Windows 7 32bit Enterprise
 
 

Found another way to do it. Just add the registry entry in the sysprep setup xml file like so:
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>REG ADD HKLM\Software\microsoft\windows\currentversion\runonce /v IUB /t Reg_SZ /d C:\mycommand.bat</CommandLine>
<Order>1</Order>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
</FirstLogonCommands>
My System SpecsSystem Spec
Reply

 Batch file requests privileges




Thread Tools




Similar help and support threads
Thread Forum
I need a batch file to open a random file within a certain folder/path
I want a batch to select and open a random link file in a folder i have. All the links are music videos I like to listen to, and I kind of want to just have an option for 'surprise me!'. I can change the file names if I have to, and I have a basic batch file ability. I know the simple commands,...
General Discussion
How to run a batch file at logoff & some batch scripting help please
Hiya, I'd just like to run a simple batch file at logoff to backup some settings. I plan to use Robocopy, which is what i use to more thorough backups. Two questions: 1. How make it run by clicking Start > Shutdown? (i realise i could make a shutdown batch file and run it instead, but i'd...
Backup and Restore
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion
batch file open file for program in the startup folder
I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the...
General Discussion
Admin privileges in batch script
Hallo, I wrote a Script that uninstalls an application, move some files and install an Application. The Script is working if I start it as Admin (right click - run as Admin ...). Everything works fine. But I want to have it working without the "run as". The script is only used in a...
Software
How to create a batch file that will move files based on the file type
How to create a batch file that will move files based on the file type? My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...
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 16:49.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App