I want to enter a command in command prompt after reaching a specific location. How can I achieve this?
e.g.,
set PathName="X:Web Content MgmtCompleted Filtering2013_Folder"
set comd="dir /b /s *.zip"
start "cmd" cd /d %PathName%
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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…