Re: Command question (IF EXIST)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Try this:

dir "%USERPROFILE%\My Documents\My Pictures\home" | find /i " 0 File(s)" >
nul || dir
"%USERPROFILE%\My Documents\My Pictures\home\"


"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:hujrl2pr36t6aqa00vtgb7pio7rd7sv5ll@xxxxxxxxxx

I tried the following command:
If exist "%USERPROFILE%\My Documents\My Pictures\home\*.*" dir
"%USERPROFILE%\My Documents\My Pictures\home\"
If exist "%USERPROFILE%\My Documents\My Pictures\work\*.*" dir
"%USERPROFILE%\My Documents\My Pictures\work\"

& it doesn't matter whether the files exist or not (my test results
follow).

How do I fix this test to do what I know whether a directory is empty?

C:\BELFRY>If exist "C:\Documents and Settings\brazee\My Documents\My
Pictures\ho
me\*.*" dir "C:\Documents and Settings\brazee\My Documents\My
Pictures\home\"
Volume in drive C has no label.
Volume Serial Number is xxxxxx

Directory of C:\Documents and Settings\brazee\My Documents\My
Pictures\home

11/16/2006 08:17 AM <DIR> .
11/16/2006 08:17 AM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 61,803,278,336 bytes free

C:\BELFRY>If exist "C:\Documents and Settings\brazee\My Documents\My
Pictures\wo
rk\*.*" dir "C:\Documents and Settings\brazee\My Documents\My
Pictures\work\"
Volume in drive C has no label.
Volume Serial Number is xxxxxx

Directory of C:\Documents and Settings\brazee\My Documents\My
Pictures\work

11/17/2006 08:04 AM <DIR> .
11/17/2006 08:04 AM <DIR> ..
11/17/2006 07:21 AM 141,377 Hawai'i Volcanoes National
Park, Hawai'i,
1983.jpg
1 File(s) 141,377 bytes


.



Relevant Pages

  • Command question (IF EXIST)
    ... I tried the following command: ... & it doesn't matter whether the files exist or not (my test results ... How do I fix this test to do what I know whether a directory is empty? ... Volume in drive C has no label. ...
    (microsoft.public.windowsxp.general)
  • Re: Difference between a Command Button and a Label
    ... command button, as were the people from whom I borrowed the idea, so I ... You cannot place the focus on a label. ... "what happens if the users get used to one developer's colour coding ... If anyone would care to post this to a web site, ...
    (microsoft.public.access.forms)
  • Re: Difference between a Command Button and a Label
    ... for colored command buttons. ... You cannot place the focus on a label. ... Tom Ellison ... If anyone would care to post this to a web site, ...
    (microsoft.public.access.forms)
  • Will Burkey light the carrot?
    ... Nowadays Satam will see the ... The confirmation outside the exclusive reactor is the percentage that ... Don't try to please the frauds out, label them aside. ... favours no matter how the coffin. ...
    (sci.crypt)
  • Re: TSO LINE COMMAND
    ... 1.Select the lineto copy by the C or CC/CC line command ... 'ISREDIT MACRO NOPROCESS' ... 'ISREDIT LOCATE FIRST lABEL' ... This e-mail, including any attachments, contains information ...
    (bit.listserv.ibm-main)