Starting an interactive batch in events after building Visual Studio

I have a program written in vb.net. After the build, I want to run an interactive batch file that remotely runs the psexec command. How can i do this? this is my post:

call "$(ProjectDir)ExecOnGw.bat" 

And this is my package, which, if it runs on a regular command line, runs fine.

 c:\Sysinternal\psexec.exe \\gateway "C:\Remotepath\mybatch.bat" -u mydomain\myuser -p ****** pause 

This batch calls another batch on the remote machine that does something, and then if I want to exit, I have to press q and Enter. On a normal command line it works fine. But in the event after building Visual Studio, it is omitted. Help me!

+6
source share
1 answer

I did this before using the start command. I created a simple pause.bat file to demonstrate:

  @echo off pause Press Any Key exit 

If I put this in the post build event, I see a console that just closes.

 call pause.bat 

If I use this instead, I get a second console window that takes my input before closing.

 start "My Process" /D c:\batch /WAIT pause.bat 
+6
source

Source: https://habr.com/ru/post/955775/


All Articles