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: 11624
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: 11165
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
2023-09-28 [Arend_] Wow even the shouts are old ;-)
2023-11-17 [Dr_Rick] I love Kixforms!
2023-11-21 [Dave_Melczer] Getting DB errors again opening posts...anyone else?
2023-11-24 [Flavien] DB errors confirmed. This forum is showing its age... UBB 7.2.2 is from 2007
2023-11-27 [Sealeopard] And there goes the forum :-(
2023-11-30 [NTDOC] Yes, so old no good easy update path
2023-12-01 [mole] Posts back. No DB errors. Thanks!
2023-12-29 [BradV] Happy new year!
2024-02-09 [RSLHA] No access possible!
2024-02-09 [RSLHA] Database Error!
2024-02-18 [Dr_Rick] What happened to Bruno
2024-03-08 [mole] Thanks for getting the posts back again.
2024-04-17 [MarineV] db errors
2024-04-18 [MarineV] will the db errors get fixed????
2024-04-26 [Tonny] database error, please!
2024-05-09 [NTDOC] I'm not seeing any errors
2024-05-31 [chojin] DB is down again \:\(
2024-06-04 [selsner] Still no access, please help!
2024-06-07 [mole] Looks like DB is back again. Thanks.
2024-06-17 [It_took_my_meds] We encountered a problem. The reason reported was Database error only visible to forum administrators Please click back to return to the previous page.
2024-07-04 [Armin73] There is still a database error 🤷‍♂️
2024-07-09 [0neZero] There is still a database error 🤷‍♂️
2024-07-10 [Allen] DB working a few times in between the messages above. Working again as of 7/10. Thanks Doc
2024-08-31 [NetGnostic] Bummer, the Database error is back.
2024-09-04 [NTDOC] Fourms are back up without error for the moment
2024-10-02 [Arend_] Wll still have database errors ;-)
2024-10-03 [Allen] Thanks to Doc... it's back.
2024-12-09 [chojin] could we move kixtart to a new place in order to keep it living ? maybe create a github page and a subreddit?
2024-12-10 [Allen] do know about moving it, but I know Doc is aware of the DB issue. Should be back online soon.
2024-12-10 [Allen] don't know...

Who's Online
0 registered and 249 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.106 seconds in which 0.039 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