0

I have a simple script to change a file name and open an excel macro concerning said file to do operations on it. When i run it, the file opens in a command prompt titled, "FM-001761-01 Substrate Thickness.xls" instead of the actual file.Code follows:

if exist "FM-001761-01 Substrate Thickness.xls" ( msg "%username%" Please move the current FM-001761-01 Substrate Thickness.xls file quit ) if exist qcprint.txt ( if exist qcprint.csv ( del qcprint.csv rename "qcprint.txt" qcprint.csv start "FM-001761-01 Substrate Thickness backup.xlsm" ) else ( rename "qcprint.txt" qcprint.csv start "FM-001761-01 Substrate Thickness backup.xlsm" ) ) else ( if exist qcprint.csv ( start "FM-001761-01 Substrate Thickness backup.xlsm" ) else ( msg "%username%" Please load the "qcprint.txt" file to the flash drive. ) ) 

enter image description here

1 Answer 1

2

The syntax of the start command (abridged, see start /? for the full syntax) is:

start ["title"] [command/program] [parameters] 

If your [command/program] is in quotes, start thinks it is the title, and since it sees no program, just starts a command window.

The solution:

start "" "FM-001761-01 Substrate Thickness backup.xlsm" 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.