Sunday, November 17, 2019

Multiple line Windows Batch File issue


I have a batch file with following contents


Line 1
"C:\Program Files (x86)\Dell\SysMgt\bmc\ipmish.exe" -interactive -ip 192.168.1.5 -u root -p Password


after this it goes to prompt
IPMISH>


Line 2
Power On


I am not sure how to pass this command line 2 to the prompt IPMISH>


What i have tried
1. adding to second line simply does nothing


Regards


Answer



A batch file does not work in this way - each line is interpreted as a command to execute in turn. When you're calling ipmish.exe, it will block the rest of the batch until the process has ended.


In order to achieve what you want to do, you could to look at the documentation for ipmish.exe and see if there is a method of scripting for it (As you're able to specify -interactive I get the impression there may be a scripted interface). Alternately, you could look into using a different software solution to execute this as a 'batch', but with the ability to send keys to it, such as AutoIt or similar.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...