how to skip a command in batch script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
riyashussain
Posts: 2
Joined: 06 May 2013 11:18

how to skip a command in batch script

#1 Post by riyashussain » 06 May 2013 12:59

Hi All,

We have a batch script listener_cntrl.bat which calls two commands "lstnr_cntrl and pause".
I am running listner_cntrl.bat on a target server with command 'cmd /c "C:\Operations\listener_cntrl.bat"'.
Since the pause/b] prompts for "Press any key to continue" and user intervention is required and because of this my automation of running the batch file is failing.
Is there any way i can skip [b]Pause
inside the batch script or anyother way to pass a switch along with my command for "Press any key to continue"

Note: I cannot edit the batch script since it is on remote server and i don't have remote access to server.

I am using remote command execution function to execute the script.

Any help is appreciated.

Thanks and Regards
Riyas

Endoro
Posts: 244
Joined: 27 Mar 2013 01:29
Location: Bozen

Re: how to skip a command in batch script

#2 Post by Endoro » 06 May 2013 14:08

you can try this (works here)

Code: Select all

<nul listener_cntrl.bat

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: how to skip a command in batch script

#3 Post by Squashman » 06 May 2013 14:56

I am confused on how you can run the batch file if you don't have access to the server. If you can remotely execute it you should be able to remotely edit it.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: how to skip a command in batch script

#4 Post by foxidrive » 06 May 2013 17:14

Endoro wrote:you can try this (works here)

Code: Select all

<nul listener_cntrl.bat


That's a good solution - it can be rewritten for the example command as such:

Code: Select all

cmd /c "C:\Operations\listener_cntrl.b<nul"

riyashussain
Posts: 2
Joined: 06 May 2013 11:18

Re: how to skip a command in batch script

#5 Post by riyashussain » 06 May 2013 20:51

Hi Squashman,
These are all customer production servers and have access only to run the script not to edit the script.
Hope this clears your confusion. If we try to edit the script and customer finds that then our project is screwed.
Also, we are running this script on more than 500 servers.

Regards
Riyas

Post Reply