1.

Solve : Simple Qusetion?

Answer»

Does anybody know how i can make a batch file that actually does what it's supposed to do, and then stay at a command prompt/save to a log file?

I plan to add this into a logfile/display in command prompt:

netstat -b -vPerhaps this is what you're LOOKING for:

netstat -b -v >>"%userprofile%\desktop\log.txt"

Save that as a batch file and when you run it, it will post the netstat results in a text file on your desktop. Of course you can edit the code to whatever you like.doesn't appear to be working...Add the directory?

"C:\" what does >> MEAN?Quote from: shing on August 13, 2007, 01:30:24 AM

what does >> mean?
Here is an example of '>>'

If you use the command 'dir c:\' in Command Prompt, you will get a list of files.
If you use the code dir c:\ >>"%userprofile%\desktop\file.txt", you won't see the list of file names in Command Prompt but there will be a text file on the desktop called 'file' with the list of files in it.> is the DOS/NT/Unix/Linux REDIRECTION character. the output of a command or PROGRAM is redirected to a file.

Used once, it creates a new file, and destroys without warning any file of the same NAME that already exists.

Used twice, it appends to a file, if it exists. If the file does not exist, it is created the first time >> is used, and appended to thereafter.


echo first line > readme.txt
echo second line >> readme.txt
echo third line >> readme.txt

Contents of readme.txt...

first line
second line
third line






Discussion

No Comment Found