Hello,
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:
cls
@echo off
:CD
cls
echo Change directory?
echo.
set /p "cho=>"
if %cho%==y goto Change
if %cho%==Y goto Change
if %cho%==n goto Open
if %cho%==N goto Open
cls
echo That's not a valid choice, dumbass.
pause
goto CD
:Open
cls
echo What would you like to open? (Name and Extension) Or type "End" to exit.
echo.
set /p "n=>"
if %n%==End goto End
if %n%==end goto End
if %n%=="End" goto End
if %n%=="end" goto End
start %n%
goto Open
goto End
:Change
cls
echo Enter the desired directory.
echo.
set /p "x=>"
CHDIR %x%
goto Open
:end
Placing quotes around the input variables opens up another cmd window for some reason...
Thanks.
Configuration: Windows XP Internet Explorer 7.0