we're running following command line
c:\util\sysinternalssuite\psexec \\10.120.36.219 -u localhost\w2k12edda -p a1b2c3d4 -h -w c:\temp\wsoe c:\temp\wsoe\postinstallphase1.cmd wsoe4r2 emea basel 1 rmavmorch33 10.120.36.219 255.255.255.192 10.120.36.193
where postinstallphase1.cmd script contains set of commands temporarily break connection target server. due these commands, psexec gets stuck , way command prompt press enter in cmd console.
this problem since plan use command in unattended solution.
we've tried use '-d' argument unknown reason if run command argument cmd script not behave expected (as without -d).
is there way simulate pressing enter key?
according to: https://serverfault.com/questions/437504/why-does-psexec-hang-after-successfully-running-a-powershell-script
you can fix issue piping command in this:
psexec \\target -u domain\username -p password cmd /c "echo . | powershell c:\path\script.ps1"
Comments
Post a Comment