Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>The NUL technique seems to only work on 8.3 compliant file names.</h2> <h3>(In other words, `D:\Documents and Settings` is "bad" and `D:\DOCUME~1` is "good")</h3> <hr> <p>I think there is some difficulty using the "NUL" tecnique when there are SPACES in the directory name, such as "Documents and Settings."</p> <p>I am using Windows XP service pack 2 and launching the cmd prompt from %SystemRoot%\system32\cmd.exe</p> <p>Here are some examples of what DID NOT work and what DOES WORK for me:</p> <p>(These are all demonstrations done "live" at an interactive prompt. I figure that you should get things to work there before trying to debug them in a script.)</p> <p><strong>This DID NOT work:</strong></p> <p><code>D:\Documents and Settings&gt;if exist "D:\Documents and Settings\NUL" echo yes</code></p> <p><strong>This DID NOT work:</strong></p> <p><code>D:\Documents and Settings&gt;if exist D:\Documents and Settings\NUL echo yes</code></p> <p><strong>This DOES work (for me):</strong></p> <p><code>D:\Documents and Settings&gt;cd ..</code></p> <p><code>D:\&gt;REM get the short 8.3 name for the file</code></p> <p><code>D:\&gt;dir /x</code></p> <p><code>Volume in drive D has no label.</code> <code>Volume Serial Number is 34BE-F9C9</code></p> <p><code>Directory of D:\</code> <BR> <code>09/25/2008 05:09 PM &lt;DIR&gt; 2008</code><BR> <code>09/25/2008 05:14 PM &lt;DIR&gt; 200809~1.25 2008.09.25</code><BR> <code>09/23/2008 03:44 PM &lt;DIR&gt; BOOST_~3 boost_repo_working_copy</code><BR> <code>09/02/2008 02:13 PM 486,128 CHROME~1.EXE ChromeSetup.exe</code><BR> <code>02/14/2008 12:32 PM &lt;DIR&gt; cygwin</code><BR></p> <p>[[Look right here !!!! ]]<br> <code>09/25/2008 08:34 AM &lt;DIR&gt; DOCUME~1 Documents and Settings</code><BR></p> <p><code>09/11/2008 01:57 PM 0 EMPTY_~1.TXT empty_testcopy_file.txt</code><BR> <code>01/21/2008 06:58 PM &lt;DIR&gt; NATION~1 National Instruments Downloads</code><BR> <code>10/12/2007 11:25 AM &lt;DIR&gt; NVIDIA</code><BR> <code>05/13/2008 09:42 AM &lt;DIR&gt; Office10</code><BR> <code>09/19/2008 11:08 AM &lt;DIR&gt; PROGRA~1 Program Files</code><BR> <code>12/02/1999 02:54 PM 24,576 setx.exe</code><BR> <code>09/15/2008 11:19 AM &lt;DIR&gt; TEMP</code><BR> <code>02/14/2008 12:26 PM &lt;DIR&gt; tmp</code><BR> <code>01/21/2008 07:05 PM &lt;DIR&gt; VXIPNP</code><BR> <code>09/23/2008 12:15 PM &lt;DIR&gt; WINDOWS</code><BR> <code>02/21/2008 03:49 PM &lt;DIR&gt; wx28</code><BR> <code>02/29/2008 01:47 PM &lt;DIR&gt; WXWIDG~2 wxWidgets</code><BR> <code>3 File(s) 510,704 bytes</code><BR> <code>20 Dir(s) 238,250,901,504 bytes free</code><BR></p> <p><code>D:\&gt;REM now use the \NUL test with the 8.3 name</code></p> <p><code>D:\&gt;if exist d:\docume~1\NUL echo yes</code></p> <p><code>yes</code></p> <p><strong>This works, but it's sort of silly, because the dot already implies i am in a directory:</strong></p> <p><code>D:\Documents and Settings&gt;if exist .\NUL echo yes</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload