如何将两个或多个命令合并到一个批处理文件中 [英] How to get two or more commands together into a batch file
本文介绍了如何将两个或多个命令合并到一个批处理文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在到达特定位置后在命令提示符中输入命令.我怎样才能做到这一点?
I want to enter a command in command prompt after reaching a specific location. How can I achieve this?
例如
set PathName="X:Web Content MgmtCompleted Filtering2013_Folder"
set comd="dir /b /s *.zip"
start "cmd" cd /d %PathName%
我正在打开命令提示符并使用 PathName
为其指定路径.现在到达该特定路径后,我想将 comd
变量插入命令提示符以获得所需的结果.
I am opening the command prompt and giving it a path using PathName
. Now after reaching that specific path I want to insert the comd
variable into the command prompt to get the desired result.
这些是我试图在批处理文件中执行的特定命令:
These are the specific commands I am trying to execute in the batch file:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:Usersanoopn>x:
X:>cd
X:Web Content MgmtCompleted Filtering2013_Folder
X:Web Content MgmtCompleted Filtering2013_Folder> dir /b /s *.zip > C:UsersanoopnDesktopabc.csv
推荐答案
获取用户输入:
set /p pathName=Enter The Value:%=%
@echo %pathName%
附言这也是有效的:
set/p pathName=输入值:
这篇关于如何将两个或多个命令合并到一个批处理文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文