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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|