A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Script Help



 
 
Thread Tools Display Modes
  #1  
Old August 21st 13, 09:52 PM posted to microsoft.public.windowsxp.general
OldGuy
external usenet poster
 
Posts: 100
Default Script Help

Win XP Pro

I want to run the following from a command (cmd.exe) window as a script
so I do not have to type this in all the time.

How do I make this a single script.

netstat –ano netstat.txt
tasklist tasklist.txt
notepad tasklist.txt
notepad netstat.txt


TIA



--- news://freenews.netfront.net/ - complaints: ---
Ads
  #2  
Old August 21st 13, 10:12 PM posted to microsoft.public.windowsxp.general
OldGuy
external usenet poster
 
Posts: 100
Default Script Help

I tried running as a .BAT but it hangs at
Notepad tasklist.txt
And I have to close it before the next line is executed so I do not get
both text files open at once.



--- news://freenews.netfront.net/ - complaints: ---
  #3  
Old August 21st 13, 10:21 PM posted to microsoft.public.windowsxp.general
Nil[_2_]
external usenet poster
 
Posts: 2,170
Default Script Help

On 21 Aug 2013, OldGuy wrote in
microsoft.public.windowsxp.general:

Win XP Pro

I want to run the following from a command (cmd.exe) window as a
script so I do not have to type this in all the time.

How do I make this a single script.

netstat –ano netstat.txt
tasklist tasklist.txt
notepad tasklist.txt
notepad netstat.txt


There's some garbage in your post in the first command, so I'll assume
you really mean "netstat netstat.txt".

Make a plain txt file called OldGuy.cmd (or whatever you want) like
this:

======== cut here ===========

netstat netstat.txt
tasklist tasklist.txt
start notepad tasklist.txt
start notepad netstat.txt

======== cut here ===========

What happens is that each command is run sequentially, each waiting for
the previous to complete itself. The first two happen quickly so it's
not a problem. The last two would wait for your interaction unless you
use the "start" command. That will cause those commands to not wait for
the previous, otherwise the last line wouldn't execute until you closed
the first instance of Notepad down.

The last two lines could also be simply, "start tasklist.txt", in which
case the text file will open with the default text editor/view (which
might or might not be Notepad.)
  #4  
Old August 22nd 13, 01:44 AM posted to microsoft.public.windowsxp.general
BeeJ
external usenet poster
 
Posts: 38
Default Script Help

Nil wrote :

There's some garbage in your post in the first command, so I'll assume you
really mean "netstat netstat.txt".

Make a plain txt file called OldGuy.cmd (or whatever you want) like this:

======== cut here ===========

netstat netstat.txt
tasklist tasklist.txt
start notepad tasklist.txt
start notepad netstat.txt

======== cut here ===========

What happens is that each command is run sequentially, each waiting for the
previous to complete itself. The first two happen quickly so it's not a
problem. The last two would wait for your interaction unless you use the
"start" command. That will cause those commands to not wait for the
previous, otherwise the last line wouldn't execute until you closed the
first instance of Notepad down.

The last two lines could also be simply, "start tasklist.txt", in which
case the text file will open with the default text editor/view (which might
or might not be Notepad.)


It looked like this -ano when I typed it in to the Cmd.exe but
somewhere along the line it got converted to this –ano during a copy
/ paste.

Thanks for the start.
That should do what I want.


  #5  
Old August 22nd 13, 01:44 AM posted to microsoft.public.windowsxp.general
OldGuy
external usenet poster
 
Posts: 100
Default Script Help

Nil wrote :
On 21 Aug 2013, OldGuy wrote in
microsoft.public.windowsxp.general:

Win XP Pro

I want to run the following from a command (cmd.exe) window as a
script so I do not have to type this in all the time.

How do I make this a single script.

netstat –ano netstat.txt
tasklist tasklist.txt
notepad tasklist.txt
notepad netstat.txt


There's some garbage in your post in the first command, so I'll assume
you really mean "netstat netstat.txt".

Make a plain txt file called OldGuy.cmd (or whatever you want) like
this:

======== cut here ===========

netstat netstat.txt
tasklist tasklist.txt
start notepad tasklist.txt
start notepad netstat.txt

======== cut here ===========

What happens is that each command is run sequentially, each waiting for
the previous to complete itself. The first two happen quickly so it's
not a problem. The last two would wait for your interaction unless you
use the "start" command. That will cause those commands to not wait for
the previous, otherwise the last line wouldn't execute until you closed
the first instance of Notepad down.

The last two lines could also be simply, "start tasklist.txt", in which
case the text file will open with the default text editor/view (which
might or might not be Notepad.)


It looked like this -ano when I typed it in to the Cmd.exe but
somewhere along the line it got converted to this –ano during a copy
/ paste.

Thanks for the start.
That should do what I want.



--- news://freenews.netfront.net/ - complaints: ---
  #6  
Old August 24th 13, 07:55 AM posted to microsoft.public.windowsxp.general
J. P. Gilliver (John)
external usenet poster
 
Posts: 5,291
Default Script Help

In message , BeeJ
writes:

Nil wrote :

There's some garbage in your post in the first command, so I'll
assume you really mean "netstat netstat.txt".

Make a plain txt file called OldGuy.cmd (or whatever you want) like this:

======== cut here ===========

netstat netstat.txt
tasklist tasklist.txt
start notepad tasklist.txt
start notepad netstat.txt

======== cut here ===========


[Actually, the second "start" might not be needed (-:]
[]
The last two lines could also be simply, "start tasklist.txt", in
which case the text file will open with the default text editor/view
(which might or might not be Notepad.)


It looked like this -ano when I typed it in to the Cmd.exe but
somewhere along the line it got converted to this –ano during a
copy / paste.


It looked like just the plain -ano when I read it in the first post too;
interesting!

Thanks for the start.
That should do what I want.


I also wondered (from my Unix days about thirty years ago!) if something
like

start notepad netstat
notepad tasklist

or

start netstat | notepad
tasklist | notepad

might work, but I haven't tried them; I don't know how well if at all
and | work with MS command-line utilities, or if even I'm using them
correctly. (A Linux fan could probably answer the last bit.)
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

782.55 - The Number of The Beast (including VAT)
  #7  
Old August 24th 13, 08:01 AM posted to microsoft.public.windowsxp.general
J. P. Gilliver (John)
external usenet poster
 
Posts: 5,291
Default Script Help

In message , "J. P. Gilliver
(John)" writes:
[]
P. S.: you made me wonder what they do, so I tried netstat and tasklist;
I'm not sure what netstat did [yes, I did netstat /? and it told me, and
I'm none the wiser (-:], and tasklist isn't recognised by my machine.
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

782.55 - The Number of The Beast (including VAT)
  #8  
Old August 24th 13, 09:02 AM posted to microsoft.public.windowsxp.general
Paul
external usenet poster
 
Posts: 18,275
Default Script Help

J. P. Gilliver (John) wrote:
In message , "J. P. Gilliver
(John)" writes:
[]
P. S.: you made me wonder what they do, so I tried netstat and tasklist;
I'm not sure what netstat did [yes, I did netstat /? and it told me, and
I'm none the wiser (-:], and tasklist isn't recognised by my machine.


I got slapped around for using tasklist here once.

Turns out, there is a copy of "tasklist" on WinXP Pro and not on WinXP Home.

So a Home user can't do "tasklist /svc" to get a list of
services and what PIDs they live in.

But you can use Process Explorer from sysinternals.com .

In the screenshot here, I show the output of tasklist /? in the upper
left, tasklist /svc in the bottom left, and the remainder of the screen
is occupied by Process Explorer.

http://imageshack.us/a/img546/9086/3c02.gif

And no, I didn't find the following page first. I tried a search on
"tasklist /svc winxp home" to verify it wasn't on Home and
I wasn't seeing things, and I found this.

http://ask-leo.com/what_is_taskliste...i_have_it.html

Paul
  #9  
Old August 24th 13, 02:15 PM posted to microsoft.public.windowsxp.general
J. P. Gilliver (John)
external usenet poster
 
Posts: 5,291
Default Script Help

In message , Paul
writes:
J. P. Gilliver (John) wrote:
In message , "J. P. Gilliver
(John)" writes:
[]
P. S.: you made me wonder what they do, so I tried netstat and
tasklist; I'm not sure what netstat did [yes, I did netstat /? and it
told me, and I'm none the wiser (-:], and tasklist isn't recognised
by my machine.


I got slapped around for using tasklist here once.

Turns out, there is a copy of "tasklist" on WinXP Pro and not on WinXP Home.


I would never slap Paul! Far too helpful.

So a Home user can't do "tasklist /svc" to get a list of
services and what PIDs they live in.

But you can use Process Explorer from sysinternals.com .

In the screenshot here, I show the output of tasklist /? in the upper
left, tasklist /svc in the bottom left, and the remainder of the screen
is occupied by Process Explorer.

http://imageshack.us/a/img546/9086/3c02.gif


Hmm - all a little too above me I fear!

And no, I didn't find the following page first. I tried a search on
"tasklist /svc winxp home" to verify it wasn't on Home and
I wasn't seeing things, and I found this.

http://ask-leo.com/what_is_taskliste...i_have_it.html

Paul


Thanks for the link - not so much that one as others on it.
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

Gravity is a myth; the Earth sucks.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.