Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1185
  • Last Modified:

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
0
dann47
Asked:
dann47
1 Solution
 
chrismanncalgavinCommented:
Hi Dann47,

I just tried your script, it seems you need to change the BAT file to read:-

Regedit /s myregistryfile.reg

And create a separate registry file (i.e myregistryfile.reg) containing what you want to insert/edit into the registry:-

Windows Registry Editor Version 5.00

[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

Then run the .bat file with .reg file in the same folder. Worked on my pc ok!

Regards,
-Chris-
0
 
jeff_01Commented:
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
0
 
dann47Author Commented:
Sorry it is a registary file
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
dann47Author Commented:
File is called wsus.reg
0
 
chrismanncalgavinCommented:
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-
0
 
dann47Author Commented:
Ok it does not look like it running the reg file to me
0
 
dann47Author Commented:
But it is, my bad i removed the silent switich and it worked
cheers all
0
 
dann47Author Commented:
Can the reg file be merged into the bat file at all?
0
 
dann47Author Commented:
Bit more info, i trying to deploy over network and the software i got will only work on one file
0
 
chrismanncalgavinCommented:
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 http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_21576219.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-
0
 
dann47Author Commented:
Take it admend
Regedit /s myregistryfile.reg

to the location?  

eg

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

-Chris-
0
 
dann47Author Commented:
Cheers will test shortly and allocate points to ya
0
 
Shift-3Commented:
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.
0
 
KromptonCommented:
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
0
 
dann47Author Commented:
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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now