07-23-2023, 05:44 AM
I have a batch file which was working quite happily, until the last couple of runs, and now it's not.
The offending code is as follows:
set uncommittedchanges=1
for /f "tokens=* usebackq" %%a in (`"C:\Program Files\Git\cmd\git" -C "\my\git\repository" status`) do (
if "%%a" == "nothing to commit, working directory clean" (
set uncommittedchanges=0
)
)
And the error I am getting is
> 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
I'm sure I haven't made any changes to these lines since it was last working, and I can't see anything wrong with the code as it stands.
Can anyone spot what's wrong, or suggest a setting I may have inadvertently changed that affects usebackq?
The offending code is as follows:
set uncommittedchanges=1
for /f "tokens=* usebackq" %%a in (`"C:\Program Files\Git\cmd\git" -C "\my\git\repository" status`) do (
if "%%a" == "nothing to commit, working directory clean" (
set uncommittedchanges=0
)
)
And the error I am getting is
> 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
I'm sure I haven't made any changes to these lines since it was last working, and I can't see anything wrong with the code as it stands.
Can anyone spot what's wrong, or suggest a setting I may have inadvertently changed that affects usebackq?