?
Solved

gpupdate bat file

Posted on 2012-03-12
11
Medium Priority
?
9,782 Views
Last Modified: 2012-03-13
hi guys
I'm looking batch file with will update polocies in domain envoriment and restart pc at prompt (after updateng polocies)
my batch file is now

"Echo Yes|gpupdate.exe /force"  BUT user still have click Y and enter and i want this be inclouded in bat

any ideas

all contributions much appreciated
0
Comment
Question by:drogi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 11

Expert Comment

by:g000se
ID: 37709287
Hi,

Try this line-

echo Yes|gpupdate /force
0
 
LVL 9

Expert Comment

by:TazDevil1674
ID: 37709289
Not all programs will accecpt text via a pipe.

Not something I have done recently but you might want to try

  gpupdate /force /yes

I know gpupdate /force /no stops the reboot...

HTH
0
 
LVL 8

Expert Comment

by:Elmar-H
ID: 37709304
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Expert Comment

by:g000se
ID: 37709306
Sry had one more item to add my post previously.  Try placing quotes around the word "yes"
0
 
LVL 8

Expert Comment

by:Elmar-H
ID: 37709333
gpupdate /force /boot works for me
0
 
LVL 1

Author Comment

by:drogi
ID: 37709345
echo yes|gpupdate /force /yes
I've tried this and no joy cmd just flashes and do nothing
0
 
LVL 25

Expert Comment

by:Lionel MM
ID: 37713947
What OS are you trying this on, version of Windows?
0
 
LVL 1

Author Comment

by:drogi
ID: 37714030
windows 7
0
 
LVL 25

Expert Comment

by:Lionel MM
ID: 37714493
Option 1
Create this in a batch file
Rem This will create a scheduled task either local or remote and will run gpupdate within 1 minute, unless you specify a start time (ST)
SCHTASKS /Create /S ComputerName /U domain\username /P password /SC MINUTE /MO 1 /TN TaskName  /TR "gpupdate /force" /ST StartTime--defaults to now if no time specified
Rem This will then reboot your PC within 3 minutes
Shutdown -f -r -t  180 -m ComputerName

Alternatively you can create a batch file for the schedule to start instead of starting gpupdate directly. If you go this root you must either have the batch file on each system or have it ina central location all users have access to--I will assume a central location located at g:\Utils\GP-Update.Bat. In this option this batch file will be scheduled and not gpupdate and shutdown/restart will not start until gpupdate is done

Option 2
Create this in a batch file
Rem GP-Update.Bat
:gpupdate /force
Shutdown -f -r -t  120

Now create a scheduled task to run this batch file
SCHTASKS /Create /S ComputerName /U domain\username /P password /SC MINUTE /MO 1 /TN TaskName  /TR G:\Utils\GP-Update.bat /ST StartTime--defaults to now if no time specified

Depending on permissions and who you specify as /U user this by itself may work but if not you may have to use the run as user command /RU and /RP (note if passwords are not specified they will be asked for). Hope this helps.
0
 
LVL 25

Accepted Solution

by:
Lionel MM earned 1200 total points
ID: 37714754
Correction--was :gpupdate (:) should be gpupdate without the :  -- sorry about that
Option 2
Create this in a batch file
Rem GP-Update.Bat
gpupdate /force
Shutdown -f -r -t  120
0
 
LVL 1

Author Closing Comment

by:drogi
ID: 37715304
thanks
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Log files are useful in diagnosing and repairing problems.  This is a list of common log files and their standard locations that I've compiled.   While this is not exhaustive, it is a pretty good list that I've found to be useful.  I may update it f…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question