cmd - How to get two or more commands together into a batch file

ID : 274340

viewed : 35

Tags : batch-filecmdvbscriptbatch-file





Top 5 Answer for cmd - How to get two or more commands together into a batch file

vote vote

90

To get a user Input :

set /p pathName=Enter The Value:%=% @echo %pathName% 

enter image description here

p.s. this is also valid :

set /p pathName=Enter The Value:

vote vote

82

You can use the following command. The SET will set the input from the user console to the variable comment and then you can use that variable using %comment%

SET /P comment=Comment:  echo %comment% pause 
vote vote

78

Try this: edited

@echo off set "comd=dir /b /s *.zip" set "pathName=" set /p "pathName=Enter The Value: " cd /d "%pathName%" %comd% pause 
vote vote

65

set "PathName=X:\Web Content Mgmt\Completed Filtering\2013_Folder" set "comd=dir /b /s *.zip" cd /d "%PathName%" %comd% 
vote vote

56

if I understand you right (not sure), the start parameter /D should help you:

start "cmd" /D %PathName% %comd% 

/D sets the start-directory (see start /?)

Top 3 video Explaining cmd - How to get two or more commands together into a batch file







Related QUESTION?