I have made a batch file that will ask you what file name you want to open and what directory it's in.
The only problem is that I can't open files with spaces in the name because it treats the first word as the whole file.
Can someone help me?
Here's the code:
echo Change directory?
set /p "cho=>"
if %cho%==y goto Change
if %cho%==Y goto Change
if %cho%==n goto Open
if %cho%==N goto Open
echo That's not a valid choice, dumbass.
echo What would you like to open? (Name and Extension) Or type "End" to exit.
set /p "n=>"
if %n%==End goto End
if %n%==end goto End
if %n%=="End" goto End
if %n%=="end" goto End
echo Enter the desired directory.
set /p "x=>"
Placing quotes around the input variables opens up another cmd window for some reason...
I know you all suffering from the problem of space in .bat file...
Here is the solution...
Use " " (doublequote space doublequote) instead of space..your problem will be solved...
It worked on my machine..
If you are satisfied with this information..plz let me know on my id
I want to open multiple files with the same extention with a batch file. Can you please send me your batch file or let me know how to create it? I've written one and it works partially. My email address is firstname.lastname@example.org.