Jump to content

Recommended Posts

Posted (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:

Capture.PNG

 

 

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 by Jaan
Posted
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 :p

 

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

  • Thanks 1
Posted (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 :D

 

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 by Jaan
Posted
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 :D

 

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 :p 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

  • Thanks 1
Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...