Support
Authorization

Newsletter

  Settings

netstat in batch

 

Forums list
Topics list
New topics
Search
Rules
Help
Login: 
Register

Pages: 1
  Views: 5960Topic:: «netstat in batch, the batch file wont execute» on forum: Network management general discussion
#1
Ok i have three batch files
the first one is named "test.bat" and the second one is called "start.bat" the third is named "query.bat".

below are the code for"test.bat"

[/QUOTE]@ echo off
:start
echo. >> log.txt
date /t >> log.txt
time /t >> log.txt
netstat -nap TCP>> log.txtdes for the batches
Quote


here is the batch for "Query.bat"
Quote

schtasks /Query
pauseq

next is the "start.bat"
[QUOTE]
schtasks /create /sc minute /mo 1 /tn "test" /tr "C:\Documents and Settings\dzta\Desktop\test.bat"

saying every 1 minute the batch file named "test.bat" will be executed.
After i execute batch "start.bat" there seems to be no execution at all. I know that because when i check the log.txt file expecting some enteries every one minute there seems to be none at all. Also if i run the batch "query.bat" i get the message

C:\Documents and Settings\dzta\Desktop>schtasks /Query
Task Name: test
Next Run: 10:54:00,
Time: 11/05/2006
Status: Could not run[QUOTE]

Please can someone here point to me where i went wrong what sdould have been done? Or suggest some good tutorial..

Thankyou smile:o
Profile
#2
You should do it this way:
File start.cmd contains the following string.

schtasks /create /sc minute /mo 1 /tn "dumpTCP" /tr "C:\WINDOWS\System32\cmd.exe /C netstat -nap TCP>> c:\logTCP.txt"

If you’ll have technical questions concerning Radmin please contact me.

Best regards,
Roman Makarov.

Famatech
Technical Support.
Profile
#3
I'm impressed, Roman. That's a good script.
Profile
Pages: 1

Users browsing this topic
Number of guests: 1, registered members: 0, in total hidden: 0

Radmin 3.5

Windows 8 Compatible

DOWNLOAD

Free for 30 days

BUY NOW

Only $49 per lifetime license
for  50 PCs - $29.8 per remote PC
for 100 PCs - $24.9 per remote PC
for 150 PCs - $23.3 per remote PC
from 200 PCs - $22 per remote PC
Follow us on Twitter
Famatech Corporation Copyright © 1999-2014 Famatech. All rights reserved.