[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Equivalent to Unix /dev/null for Windows (need black hole for output)

Posted on 2004-04-10
6
Medium Priority
?
1,741 Views
Last Modified: 2009-07-29
In Unix scripts and C programs, you can redirect output or write to a special file called "/dev/null".  This is useful if you need to write to a file, don't want the output, and don't want to actually create a temporary file and delete it later.

Below is the line of code I wish would work (it does not work):

DoCmd.OutputTo acOutputReport, RptName, acFormatSNP, "/dev/null", False

...where /dev/null is normally a valid file name.

What is the Windows equivalent to Unix's /dev/null?

Thanks,
Steve
0
Comment
Question by:geekboysteves
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 10797721
>> What is the Windows equivalent to Unix's /dev/null?

Possibly XP's "Null Device Driver". On Win9x, there may be a null port you can add for devices/hardware.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xpehelp/html/NullDeviceDriver.asp
0
 

Author Comment

by:geekboysteves
ID: 10797749
zzzzzooc,
Thanks but I need more detail.  This is the full content of the link you provided:
Microsoft Windows XP Embedded  
============
Null Device Driver
The Null Device Driver component provides the functional equivalent of \dev\null in the Unix environment by accepting I/O request packets and returning them to the caller.

Services
There are no services for this component.

Associated Components
No other components interact with this component.

Settings
There are no configurable settings for this component.
--------------------------------------------------------------------------------
 Last updated on Friday, August 29, 2003
===============
Not much to go on!
Thanks though.
Steve
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 10797891
You'll probably have to install one yourself if one doesn't already exist. I don't have any experience with such so I'm not sure if this will apply to your scenario or not but it seems to be the equivalent to /dev/null on *nix platforms.

"Installing a Null Driver"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/specinst_0msn.asp
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:geekboysteves
ID: 10797898
Interesting.
I assumed there was something built-in.  I need something I can rely on on any Windows computer.  Isn't there something like PRN: and AUX: from the old DOS days?  Wasn't there a NUL: ?

Examples:

c:> echo This text will print > PRN:
c:> echo This text is going nowhere > NUL:

Thanks,
Steve

0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 375 total points
ID: 10797948
Those should still apply for Win9x/Win2k/WinXP if you can apply them to your scenario.

C:\>echo "Test" > nul

^^ Shouldn't output anywhere. Not sure if " " will work on Win9x though. I just checked with FileMon and there's nothing being written to disk with that.
0
 

Author Comment

by:geekboysteves
ID: 10797996

NUL

That's it!  I knew it was something like that.  I tried it* on NT4, Windows Server 2003, Windows XP Home and Windows 2000 Server and it works just as /dev/null does under Unix.

Thanks,
Steve

* it = echo aaaaaaaaaaaaaaaa > nul

Did not create a file named "nul" and did not display any aaaaaaaaaaaaaaaaaa's or an error.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question