rfwilkinson

Commendable
Aug 11, 2016
2
0
1,510
I am trying to automate a process that spans several servers and am using batch files and PSEXEC to accomplish that. I have it all working but am running into one issue. I am running a command remotely that requires a Y to confirm the action. There is no quiet mode, /y flag, or any other argument that I can see to get around this. I have tried to put a pipe |Y on the end of the psexec line, I have tried a batch file with echo Y| on the front and |Y on the end. Every time, I get a "Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read." message... Any help?
 
Solution
How often is this run? You can't remote into the servers and run this manually?

How about using the scheduler to run the script at a certain time and copy the script locally to the servers.

I was never good at using psexec to get it going.

rfwilkinson

Commendable
Aug 11, 2016
2
0
1,510


Thanks for the suggestion. I now have a VBS file (see code below) and it runs fine when on the actual system but when run using psexec.exe \\servername cscript c:\script.vbs (also tried -i and wscript), it exists with an error level of 0 and it stays up for the complete "wait" time. But it isn't running..
'VBScript Example
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "C:\Deployable_Packages\20160811e_Appsuite_Importers\AXUpdateInstaller.exe import -runbookfile=C:\Deployable_Packages\20160811e_Appsuite_Importers\20160811e_Appsuite_Importers.xml"
WshShell.AppActivate "AXUpdateInstaller"
Wscript.Sleep 13500

WshShell.SendKeys "Y"


 
How often is this run? You can't remote into the servers and run this manually?

How about using the scheduler to run the script at a certain time and copy the script locally to the servers.

I was never good at using psexec to get it going.
 
Solution

TRENDING THREADS