Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
keyboard1333a
#1
Post
by keyboard1333a » 10 Dec 2011 17:17
I'm trying to test to see if a directory exists
Code: Select all
echo off
cls
IF EXIST C:\Documents and Settings\Owner\Desktop\New Folder (
echo exists
) ELSE (
echo does not exist
)
pause
but it dosn't like the spaces in the path (C:\Documents and Settings\Owner\Desktop\New Folder )
Is there a way aroung this.
Thanks Keyboard1333

-
Ed Dyreen
- Expert
- Posts: 1569
- Joined: 16 May 2011 08:21
- Location: Flanders(Belgium)
-
Contact:
#2
Post
by Ed Dyreen » 10 Dec 2011 18:05
'
Code: Select all
echo off
cls
IF EXIST "C:\Documents and Settings\Owner\Desktop\New Folder" (
echo exists
) ELSE (
echo does not exist
)
pause
"

"
-
keyboard1333a
#3
Post
by keyboard1333a » 10 Dec 2011 18:15
I don't understand. The code you posted is exactly the same as the original. How is that to help. Unless you mean the ' at the top of your post. Please try to clarify your reply a bit.
-
dbenham
- Expert
- Posts: 2461
- Joined: 12 Feb 2011 21:02
- Location: United States (east coast)
#4
Post
by dbenham » 10 Dec 2011 19:48
Look again...
... Ed's code has quotes around the path