0

Below is my batch file script

@echo off
setlocal enableextensions enabledelayedexpansion
for /f %%b in (C:\COST\Programlink.txt) do (
%%b
pause
)

And in the programlink.txt as mentioned in the above batch command I have the link of the file I want to open

"D:\COST\Mustafa Batch files\Batch files\1.txt"

But when I run the batchfile script it shows the below error

'"D:\COST\Mustafa' is not recognized as an internal or external command,
operable command or batch file.
Press any key to continue...

But when i enter the below command directly into the CMD prompt it works fine.

 "D:\COST\Mustafa Batch files\Batch files\1.txt"

I just want to open 1.txt file using my batch script I mentioned above. I can't identify my mistake. Please help me to right my batchfile.

0

I used the modified batchfile as below by using "usebackq delims=" and works well

@echo off
setlocal enableextensions enabledelayedexpansion
for /f "usebackq delims=" %%b in (C:\COST\Programlink.txt) do (
%%b
pause
)

But this is only one half of my batchfile. I shall proceed further and will come back if face any further problems.

And It has worked well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.