Skip to main content
added 16 characters in body
Source Link
Mark Deven
  • 1.7k
  • 12
  • 44
  • 79

I have a batch file. In which, I need to start another copy of itself in a new window with a parameter. I tried the command start "" "%~0" "Param" but it said '"Param"' is not recognized as an internal or external command, operable program or batch file. and didn't start anything. The only way I could get it to work was start %~0 Param , but I figured that would crash if the path had spaces. So What is the correct way to start another instance of the current batch file with parameters?

I have a batch file. In which, I need to start another copy of itself with a parameter. I tried the command start "" "%~0" "Param" but it said '"Param"' is not recognized as an internal or external command, operable program or batch file. and didn't start anything. The only way I could get it to work was start %~0 Param , but I figured that would crash if the path had spaces. So What is the correct way to start another instance of the current batch file with parameters?

I have a batch file. In which, I need to start another copy of itself in a new window with a parameter. I tried the command start "" "%~0" "Param" but it said '"Param"' is not recognized as an internal or external command, operable program or batch file. and didn't start anything. The only way I could get it to work was start %~0 Param , but I figured that would crash if the path had spaces. So What is the correct way to start another instance of the current batch file with parameters?

Source Link
Mark Deven
  • 1.7k
  • 12
  • 44
  • 79

What's a correct way for a batch file to run itself with params?

I have a batch file. In which, I need to start another copy of itself with a parameter. I tried the command start "" "%~0" "Param" but it said '"Param"' is not recognized as an internal or external command, operable program or batch file. and didn't start anything. The only way I could get it to work was start %~0 Param , but I figured that would crash if the path had spaces. So What is the correct way to start another instance of the current batch file with parameters?