简体   繁体   English

在批处理文件中运行带有参数的命令

[英]Run command with parameters in batch file

Assume a psuedo command: 假设一个伪命令:

 psuedocmd.exe

It has various parameters like: 它具有各种参数,例如:

/scan  /save  /savefolder

Now i want to run psuedocmd.exe using batch file. 现在,我想使用批处理文件运行psuedocmd.exe。 And i would like to use parameters too. 而且我也想使用参数。 I am using the following line in batch file 我在批处理文件中使用以下行

psuedocmd.exe /scan /save

But in this case psuedocmd.exe is running without the parameters. 但是在这种情况下,psuedocmd.exe在没有参数的情况下运行。

Try putting parameters between quotes "parameter value" , especially if paths have spaces in them. 尝试将参数放在引号"parameter value" ,尤其是在路径中包含空格的情况下。

Check if the batch text file is not saved in some encoding making your / be read as an escape character. 检查批处理文本文件是否未以某种编码保存,从而使您的/被读取为转义字符。

If you want to run the .exe by handing over parameters from the batchfile, don't use variables, just use %1, %2, etc. 如果要通过移交批处理文件中的参数来运行.exe,请不要使用变量,而应使用%1,%2等。

run.bat /save /folder

Where run.bat's contents are: run.bat的内容在哪里:

pseudocommand.exe %1 %2

Hehe, after over half a year, I'm out of patience.. 呵呵,过了半年,我没有耐心了。

You must provide the savefolder parameter when using the save parameter in Acunetix Web Vulnerability Scanner , making that line in your batch-file look like: Acunetix Web漏洞扫描程序中使用save参数时,必须提供savefolder参数,使批处理文件中的该行类似于:

wvs_console.exe /scan "http://www.aaa.com" /save /savefolder "c:\log" 

Excerpt from the documentation: 文档摘录:

/scan          Scans a single website.
               Syntax: /scan [url]
               Example: /scan http://testphp.vulnweb.com

/save          Saves scan once scan is finished. The file will be 
                 saved in the location specified by the “/savefolder” switch.
               Syntax: /save

/savefolder    Specify the folder were all the scans and other 
                 scan related files will be saved.
               Syntax: /savefolder [directory]
               Example: /savefolder C:\Acunetix\Scans

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM