1.

Solve : Help with batch file please?

Answer»

Hi all, i am TRYING to create a bat file that simply runs gpupdate /force and then answers no (automatically) to logoff and closes automatically, i PRESUME this might be a common question but wondered if anyone can help me with the SCRIPTING for this.
currently have

ECHO ON
gpupdate /force
EXIT

many thanks what is the problem with your's.

try this:
Code: [Select]ECHO OFF
ECHO REFRESHING POLICY
ECHO.
GPUPDATE /force
end

The problem is that i need it to automatically say no to logoff and need it to exit after that.
It's ALMOST like i need the code to (n) enter then exit so it closes the DOS screen.
I need this for a vpn solution so it turns off the local firewall and drags the group policy down before logging into the vpn connection,simply cause we are having issues with time outs due to certain ports dropping on the local machines firewall.

Thank you though. Not all programs can take input from the pipe, but this may be worth a try:

Code: [Select]ECHO ON
echo N | gpupdate /force
EXIT

Good luck. 



Discussion

No Comment Found