Page 1 of 2 12>
Topic Options
#123598 - 2004-07-22 09:08 PM Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Good afternoon Gentlebeings:
Hope you can help.
Why doesn't this return stdoutput and stderr to the log?
Code:

SHELL "%COMSPEC% /C XCOPY C:\TEST\O\*.* C:\TEST\A\*.* /y /r /v /f /e >>C:\logs\test.log 2>>C:\logs\test.log"


Thanks
Stanley
_________________________
Taxation WITH representation isn't so hot, either!

Top
#123599 - 2004-07-22 11:09 PM Re: Redirecting SHELL cmd errors
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Hi Stanley,

Your syntax is incorrect for what you're wanting to accomplish. Please review this post which should help you. If you still need assistance further let us know.

COMSPEC Question
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB2&Number=115983

Top
#123600 - 2004-07-22 11:11 PM Re: Redirecting SHELL cmd errors
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not sure what is wrong in it.
looks fine to me.
_________________________
!

download KiXnet

Top
#123601 - 2004-07-22 11:29 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
They error I get is
"The process cannot access the file because it is being used by anther process"
I didn't find anything in the link about redirecting output.
Appreciate the effort though
_________________________
Taxation WITH representation isn't so hot, either!

Top
#123602 - 2004-07-22 11:30 PM Re: Redirecting SHELL cmd errors
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the error is pretty clear.
kinda like, your log file is opened for explicit writing so it can't be written to.
_________________________
!

download KiXnet

Top
#123603 - 2004-07-22 11:37 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Laziness takes its toll. I did not read all of the links. Found it in the second one.
Code:
  
SHELL "%COMSPEC% /C XCOPY C:\TEST\O\*.* C:\TEST\A\*.* /y /r /v /f /e >>C:\logs\test.log 2>&1"



This did what I wanted. Thanks DOC. Give that man a star.
_________________________
Taxation WITH representation isn't so hot, either!

Top
#123604 - 2004-07-23 12:51 AM Re: Redirecting SHELL cmd errors
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What about the guy that wrote the FAQ? Does he not get a star?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#123605 - 2004-07-23 03:18 AM Re: Redirecting SHELL cmd errors
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Just ONE lousy star? What's up with that? Give that being five! And the FAQ Writer as well!
_________________________
There are two types of vessels, submarines and targets.

Top
#123606 - 2004-07-23 04:14 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Okay Okay Two stars for DOC for pointing me in the right direction and three stars for robvandewoude.com for having the info I needed. Everyone else gets one star for effort.


_________________________
Taxation WITH representation isn't so hot, either!

Top
#123607 - 2004-07-23 04:21 PM Re: Redirecting SHELL cmd errors
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm ... the rating system has to be understand diferently.

->Rate a user ONE star (*) only if you are really pissed off by his reply

->Forget all ratings in between as they really obfuscate the overall reflection of the rating situation of this User

->Rate 5 stars (*****) if you are satisfied with the answer(s); Like 'Wow, this guy really saved me half a day of work or even better my job'

hth


Edited by Jochen (2004-07-23 04:28 PM)
_________________________



Top
#123608 - 2004-07-23 04:28 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Mea Culpa Mea Culpa Mea Maxima Culpa
Five stars for everyone
Laziness strikes again.
Sorry Stanley
_________________________
Taxation WITH representation isn't so hot, either!

Top
#123609 - 2004-07-23 04:32 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Mea Culpa Mea Culpa Mea Maxima Culpa
or something like that. I apologize if I have offended anyone . Now that I understand the rating system.
Five stars for everyone.
Thanks for setting me straight.
_________________________
Taxation WITH representation isn't so hot, either!

Top
#123610 - 2004-07-23 04:50 PM Re: Redirecting SHELL cmd errors
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no big deal.
but it feels little painfull if you help someone and get your rating lowered by that
_________________________
!

download KiXnet

Top
#123611 - 2004-07-23 04:56 PM Re: Redirecting SHELL cmd errors
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

three stars for robvandewoude.com




and I thought you gleaned the info from my FAQ.

Not quite everything you wanted to know about RUN and SHELL

Guess I am not worthy of your vote then.

BTW, somone gave me 1 lousy star, knocking down the 5 I had to the current 4. If only I knew who...
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#123612 - 2004-07-23 04:57 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
I apologize again, but back to the original issue.
Is there a way to return any errors to the Kix script?
Code:
  
$ret = SHELL "%COMSPEC% /C XCOPY C:\test\a\$filename C:\test\o\*.* /y /e /f /v /r >>C:\_test\test.log 2>&1"



kicks up an "ERROR: Error in expression.!"
_________________________
Taxation WITH representation isn't so hot, either!

Top
#123613 - 2004-07-23 05:00 PM Re: Redirecting SHELL cmd errors
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Are you talking about the error text or ERRORLEVEL? ERRORLEVEL is returned as @Error. There are various Pipe() UDFs that can return SHELLed output back to KiX.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#123614 - 2004-07-23 05:01 PM Re: Redirecting SHELL cmd errors
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
SHELL doesn't return a value. Check @ERROR to find the return code from programs run through SHELL (i'm trying for a five-star rating too) :0)

-Shawn

Top
#123615 - 2004-07-23 08:18 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Actually I am trying to get a return from any shell command. I did realize that @ERROR returns correctly, but what i am trying for is this.
I am transferring files via FTP and when I run the SHELL to run the FTP session I was hoping to be able to get the results into the KIX script so I can update an inhouse job monitoring system as to whether the files were actually FTP'd or not.
Shawn:
I have been monitoring this board for a while now , but just joined recently and from your past responses to other peoples questions I would say you deserve five stars.
_________________________
Taxation WITH representation isn't so hot, either!

Top
#123616 - 2004-07-23 08:33 PM Re: Redirecting SHELL cmd errors
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
check the udf library for ftpGet() (see my sig for alphabetical listing of all those 480+ udfs)
_________________________
!

download KiXnet

Top
#123617 - 2004-07-23 08:46 PM Re: Redirecting SHELL cmd errors
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Thank you Lonk

_________________________
Taxation WITH representation isn't so hot, either!

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.075 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org