VB Script
--
Questions
--
Followers
Top Experts
I need to run a GPUpdate /force in VBS as part of the Computer Startup Script. Is this possible? Reason I ask is because PC's do not appear to be syncing to our GPO's correctly, so at the moment I'm having to run a gpupdate /force on all users PC's manually.
I have got a batch file, but would prefer to have this in my VBS.
CD\
echo No|gpupdate /force
Any ideas?
Thanks.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
set objShell = CreateObject("Wscript.Shel
objShell.Run "gpupdate /force",0,true
I copied the above into a test VBS, but the wscript.exe has been in my task manager for at least 4 minutes now. When I run GPupdate from cmd manually and say NO to log off, it only takes about 40 seconds.
Could it be waiting for some kind of user input, but in the background? Or has this script been specifically designed for the Computer Startup Script only, and not to be used during Windows?
Thanks.
So I'm assuming that it did run, but only when applied to the Computer Startup Script?
Silly question, but what is the difference between True and False. Do they both do what I want, but False bypasses the "please logoff message"?






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
The difference is that if you choose "true". The wscript.exe will wait until the gpupdate.exe is closed. If you choose "false" it will not wait and just close independed of the gpudpate.exe.
If you run the script with user rights (user logon script) it will update the user policy part. If you run it with computer rights (computer starup script) it will update the computer policy part.
VB Script
--
Questions
--
Followers
Top Experts
VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.