Jaan Posted June 7, 2023 Posted June 7, 2023 (edited) Long story short.... I just want to manunally run GPUPDATE /force and have the promts to restart and log off to select N and then press any key to close after completion. Here's what i have: @echo on cd\ C: echo n | gpupdate /force /wait:60 pause exit where's what i get on the client machine: If i change it to: @echo on cd\ C: echo [color="#FF0000"]y[/color] | gpupdate /force /wait:60 pause exit it works fine but restarts the computer which i dont want. Any ideas? Edited June 7, 2023 by Jaan
Steve21 Posted June 7, 2023 Posted June 7, 2023 Long story short.... I just want to manunally run GPUPDATE /force and have the promts to restart and log off to select N and then press any key to close after completion. Here's what i have: @echo on cd\ C: echo n | gpupdate /force /wait:60 pause exit where's what i get on the client machine: [ATTACH=CONFIG]69106[/ATTACH] If i change it to: @echo on cd\ C: echo [color="#FF0000"]y[/color] | gpupdate /force /wait:60 pause exit it works fine but restarts the computer which i dont want. Any ideas? What’s the actual issue? As that looks like it’s working as you asked Says N to reboot then you’re asked if you want to log off If your machine is returning a reboot and then a log off option you’d need to echo twice out as you’re only responding to one so far Steve 1
Jaan Posted June 7, 2023 Author Posted June 7, 2023 (edited) I wanted to batch file to auto select N for both prompts (so the end user doesn't have to) then close. I'm nursing a issue were some of the printers aren't deploying. Running gpupdate /force fixes the issue. If i can tell the end user to "click the Fix printers icon to resolve the issue" that would be great. Otherwise its "can you click the Fix printers icon then once its finished, type N on do you want to restart prompt,then type N again on the do you want to log off then click anykey to close it....... I can then concentrate on the actual issue At the end of the screenshot above, it displays the two prompts on the bottom line instead of automatically selecting N for the user on both accounts. EDIT: where do i need to add the other echo you mentioned for the second prompt? Cheers Edited June 7, 2023 by Jaan
Foresthippy Posted June 7, 2023 Posted June 7, 2023 echo n | gpupdate /target:user /force echo n | gpupdate /target:computer /force Or identify whether its user or computer that fixes it and only use the one. 1
Steve21 Posted June 7, 2023 Posted June 7, 2023 I wanted to batch file to auto select N for both prompts (so the end user doesn't have to) then close. I'm nursing a issue were some of the printers aren't deploying. Running gpupdate /force fixes the issue. If i can tell the end user to "click the Fix printers icon to resolve the issue" that would be great. Otherwise its "can you click the Fix printers icon then once its finished, type N on do you want to restart prompt,then type N again on the do you want to log off then click anykey to close it....... I can then concentrate on the actual issue At the end of the screenshot above, it displays the two prompts on the bottom line instead of automatically selecting N for the user on both accounts. EDIT: where do i need to add the other echo you mentioned for the second prompt? Cheers Just as a note but you wouldn’t need to use force to map printers normal gpuodate would work which removes the issue mentioned as it’s only asking we you’re using force, as force just overwrites all gpos again But in regards to your query, you have it replying N to the first one, but then it’s waiting on the second So you’d need to add another echo at the start so it does two echos of N to answer both queries Steve 1
Jaan Posted June 7, 2023 Author Posted June 7, 2023 Sorted thanks all, went with this; @echo on cd\ C: echo n | gpupdate /target:user /force /wait:60 echo n | gpupdate /target:computer /force /wait:60 exit
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now