Link to home
Start Free TrialLog in
Avatar of dann47
dann47

asked on

BAT File (make silent

COuld someone assist with this bat file please.
Need to make it run silent, without asking "are you sure you want to add this to the registary" on xp

REGEDIT /S

// Registry file generated by the Application Launcher.

[HKEY_LOCAL_MACHINE\SOFTWARE]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]
"TargetGroup"="Windows"
"TargetGroupEnabled"=dword:00000001
"WUServer"="http://selby1:8530/"
"WUStatusServer"="http://selby1:8530/"

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
"AUOptions"=dword:00000004
"AutoInstallMinorUpdates"=dword:00000001
"DetectionFrequency"=dword:00000006
"DetectionFrequencyEnabled"=dword:00000001
"NoAutoRebootWithLoggedOnUsers"=dword:00000001
"NoAutoUpdate"=dword:00000000
"RebootRelaunchTimeoutEnabled"=dword:00000001
"RebootRelaunchTimeout"=dword:0000001e
"RescheduleWaitTime"=dword:0000003c
"RescheduleWaitTimeEnabled"=dword:00000001
"ScheduledInstallDay"=dword:00000000
"ScheduledInstallTime"=dword:00000003
"UseWUServer"=dword:00000001

As can see i already tried

Cheers all
ASKER CERTIFIED SOLUTION
Avatar of chrismanncalgavin
chrismanncalgavin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeff_01
jeff_01

I presume all the changes you want to make are in a file that is appropriatly named eg changes.reg. Then in your batch file you have

regedit /S changes.reg

Is that correct?

the /S is the switch that suppresses the "are you sure" confirmation box.

Jeff
Avatar of dann47

ASKER

Sorry it is a registary file
Avatar of dann47

ASKER

File is called wsus.reg
You just need to make sure you have a separate batch file which JUST contains the line:

Regedit /s wsus.reg

and then providing your registry file is in the right format and works by running it directly (double clicking on it), you should have no problems.
Also, do you have administrator rights on the machine you are using? If not, then that could be the problem!

-Chris-
Avatar of dann47

ASKER

Ok it does not look like it running the reg file to me
Avatar of dann47

ASKER

But it is, my bad i removed the silent switich and it worked
cheers all
Avatar of dann47

ASKER

Can the reg file be merged into the bat file at all?
Avatar of dann47

ASKER

Bit more info, i trying to deploy over network and the software i got will only work on one file
Hi again Dann47,

The reg file could be put into a BAT file directly, but its not very easy and a bit messy.
I would say keep it as a seperate file, OR you could do it with VBSCRIPT. If you know how to do that, I have used it for registry entries before and you could create a single .VBS file with that. (See https://www.experts-exchange.com/questions/21576219/VBScript-for-registry-editng.html)

As far as distributing over the network goes, I have done this by putting the .REG file into a shared folder on the server, and pointing the batch file to this location for the .reg file. Then all the Workstations have to do is to run the batch file.

Hope this helps.

-Chris-
Avatar of dann47

ASKER

Take it admend
Regedit /s myregistryfile.reg

to the location?  

eg

Regedit /s \\server\share.reg?
Yeh thats right, just make sure that everyone has read and execute rights to that .reg file. Otherwise should be fine.
Good luck

-Chris-
Avatar of dann47

ASKER

Cheers will test shortly and allocate points to ya
You asked about incorporating the registry entries into the batch file itself.  If you are going to be running it on all Windows XP machines then you can use the REG command to accomplish this.  For example:

REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetGroup /t REG_SZ /d Windows
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetGroupEnabled /t REG_DWORD /d 00000001
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v WUServer /t REG_SZ /d http://selby1:8530/
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v WUStatusServer /t REG_SZ /d http://selby1:8530/

This command does not work on Windows 2000 however.
Shift-3 has a good soultion if you want it done with only a batch file. The only addition I would suggest is adding a "/f" (without quotes) to the end of each Reg Add line so if the value exists it won't pause to ask if you want to overwrite the value.

Krompton
Avatar of dann47

ASKER

Sorry about Delay, been on holiday - here some advice, dont go to pahos!!

wpadron, do not like the active domain route, it does not work on our server for some reason, never had chance to disrupt the company and look into it.

Shift 3 - Looks good, will try