forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Tasklist piping problem

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Mon Jul 11, 2011 10:48 am    Post subject: Tasklist piping problem Reply with quote

Hi All

I can not get the following code to work...
Code:
list create,1
list add,1,"tasklist /svc"
runz cmd.exe" /c tasklist /svc",pipe,wait 15
list append,1,@pipe()
exit

The piped data is incomplete. I've tried using an untimed wait but
VDS just hungs. I've also tried a 60 second wait but the piped data
is still incomplete. If I run Tasklist /svc from a console it is almost
instant. Any ideas why it does not capture all the output??

Thanks

David...
Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Mon Jul 11, 2011 2:00 pm    Post subject: Reply with quote

I know this doesn't answer your question but using WAIT with PIPE does nothing. With PIPE the script halts until the console closes anyway.
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Mon Jul 11, 2011 2:13 pm    Post subject: Reply with quote

Try this
Code:
list create,1
list add,1,"tasklist /svc"
runz cmd.exe /c tasklist /svc,pipe
list append,1,@pipe()
list savefile,1,@path(%0)temptsklst.txt
run notepad.exe @path(%0)temptsklst.txt
exit


The above works for my on Win7 x64.
Note make sure you save this script before running or the @path() functions won't work.
Back to top
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Mon Jul 11, 2011 6:39 pm    Post subject: Reply with quote

Your code posted above worked fine for me. See screenshot.

I am running Window 7 Home Premium.

http://cl.ly/0i2u2u2n3T0y1D0Q0d27

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Wed Jul 13, 2011 10:49 am    Post subject: Reply with quote

Thanks for your help. This is what worked for me in the end and its fast enough for my needs.
Code:
    list create,1
    list create,2
    list add,1,"tasklist /svc"
    runz cmd.exe" /c tasklist /svc > %temp%\zzzzu.txt",wait 30
    list loadfile,2,@env(temp)\zzzzu.txt
    list append,1,2
    file delete,@env(temp)\zzzzu.txt
    list close,2

I don't know why the original code didn't work. Perhaps its our H.I.P.S. or A.V. software that stops the piping???

Thanks

David
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group