Computing.Net > Forums > Disk Operating System > The Nul Command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

The Nul Command

Reply to Message Icon

Name: RWills
Date: April 20, 2004 at 11:17:50 Pacific
OS: Win2000 Pro
CPU/Ram: 1.4ghz/512mb
Comment:

I have a batch file using >Nul to supress the output, however it also needs to write to a new file, however when writing to the second batch file the >Nul does not get written. What is the syntax I should using? I currently have this:

echo <somecommand> >Nul >>%tempfile%

However when looking at the temp file created, it wrote the following:

echo <somecommand>

Any suggestions?




Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: April 20, 2004 at 12:28:50 Pacific
Reply:

Hi
Use the ^ symbol to stop it being used as a output to a device. ie Nul or FileName.

echo Command ^> null ^>^> %tempfile%


0

Response Number 2
Name: Mechanix2Go
Date: May 28, 2004 at 05:03:15 Pacific
Reply:

Hi,

NUL is not a command. It's a device defined by the OS. It's the 'bit bucket' so when you redirect output to NUL, it just gets thrown away. Ditto for 'copy/b filename nul' ensures that a file can really be read.

One goofy thing about w2k is that there's no NULL; just NUL. I'm almost sure that in DOS 3.x and up it was NULL.

Another goofy: you may recal the device CTTY. It seems to have gone away in w2k.

As for the original issue, I tried this:
@echo off
echo xcopy>thisfile

Works with no use of NUL. Maybe I missed your point.

And while we're almost on the subject, will someone running XP do 'set' and tell me the OS variable?

In w2k it's OS=Windows_NT

Ineed to make a batch file smart enough to run on boxes with/without CHOICE.COM

Hope this Helps.

Peter

Mechanix2Go@Golden-Triangle.com


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: The Nul Command

How to use the AT command www.computing.net/answers/dos/how-to-use-the-at-command/11130.html

The FIND command www.computing.net/answers/dos/the-find-command/13233.html

What is >nul mean do in a batch file www.computing.net/answers/dos/what-is-nul-mean-do-in-a-batch-file/197.html