#171822 - 2006-12-20 06:16 PM
Re: @error handling? and redirection to a text file (append)
[Re: itdaddy]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Hi ITDaddy, and welcome to the board.
You should place your code between code tags.
Is the code you are posting part of a logon script or is it part of a utility?
The reason I ask is because if this is a logon script there would be not reason to loop thru all your PC's and you could use the @WKSTA macro to retrieve the PC name.
If this is part of a utility to look at each PC, it will be hard to find out if it had trouble logging in or whatever.
It might be best if you post your entire code so that we can better help you.
|
Top
|
|
|
|
#171832 - 2006-12-20 07:35 PM
Re: @error handling? and redirection to a text file (append)
[Re: itdaddy]
|
Anonymous
Anonymous
Unregistered
|
Hey benny69 thanks! i tried to look for quotes are the image tags here the same as quotes where are they?? the buttons i mean? thanks
"Is the code you are posting part of a logon script or is it part of a utility?"
No; it is a program executed from a batch file like kix32 filename.kix. I run it on a server through the schedular. reason being is we run it at night while all workstations are on. It is for copying some mdb files to workstations. user dink around while they are downloading these and they get corrupt so we leave PCs on and run on schedule at night and we want to see which ones fail and which ones succeed thus the two txt files redirected to. I made a program in DOS batch that works with ERRORLEVEL just fine but it is hard to loop through arrays in DOS; i cant find how to do arrays in DOS? nicely! heheeee. Everything works great but i dont know how to redirector PC name to each file upon conditon met. The kicker is it creates the mapped drive from one admin server thus the /delete switch so i can go to each pc with mapped drive. i need to do it this way due to after hours.
not logging on i need a failure to connect error like error 53 or 67 in dos i heard in kix if the mapped command fails @Error is set to non zero which is fail? this is the entire code minus the batch file that kix it off. thanks
The reason I ask is because if this is a logon script there would be not reason to loop thru all your PC's and you could use the @WKSTA macro to retrieve the PC name.
If this is part of a utility to look at each PC, it will be hard to find out if it had trouble logging in or whatever.
It might be best if you post your entire code so that we can better help you.
|
Top
|
|
|
|
#171835 - 2006-12-20 09:33 PM
Re: @error handling? and redirection to a text file (append)
[Re: Les]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
I would still like to see your script, but rather than looking for an @Error i would suggest you use something like Ping().
|
Top
|
|
|
|
#171836 - 2006-12-20 09:43 PM
Re: @error handling? and redirection to a text file (append)
[Re: Les]
|
Anonymous
Anonymous
Unregistered
|
Hey thanks
but when i first registered it would not let me and then it said there was another itdaddy but when i looked there was an idaddy; big diff....i am itdaddy..like whose your IT Daddy and i dont know who is idaddy? there are no searches for anything that guy. but please keep me as ITDADDY like my icon/avatar! thanks
hey any tips on my question?S thank les love your avatar that is funny $h$$
|
Top
|
|
|
|
#171837 - 2006-12-20 09:51 PM
Re: @error handling? and redirection to a text file (append)
[Re: Benny69]
|
Anonymous
Anonymous
Unregistered
|
FourthAveArray = "ftran1", "ftran2", "ftran3"
For Each $Element In $FourthAveArray
Shell "net use z: \\" + $Element + "\c$" ;if connection error, push pcname to failure.txt ;else if no error push pcname to success.txt Shell "CMD.EXE /C copy c:\fspcopy\*.mdb z:\fsp\mdb /y" Shell "CMD.EXE /C time /t" Shell "net use z: /delete"
Next
benny69 this is my coding! except the lines commented out.
it loops until array is empty and at each loop it runs shell commands (or dos commands) like this: maps drive z copies mdb files removed mapped drive loop back and do for next pcname get it
|
Top
|
|
|
|
#171839 - 2006-12-20 09:55 PM
Re: @error handling? and redirection to a text file (append)
[Re: ]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
look an the linky i posted, i think that it is what you are wanting. it will allow you to try to connect to the pc and will give back an error if it can not.
|
Top
|
|
|
|
#171842 - 2006-12-20 10:41 PM
Re: @error handling? and redirection to a text file (append)
[Re: ]
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
As for posting and editing of your posts it should be pretty easy, but for those that need a visual.
.
|
Top
|
|
|
|
#171843 - 2006-12-20 10:42 PM
Re: @error handling? and redirection to a text file (append)
[Re: NTDOC]
|
Anonymous
Anonymous
Unregistered
|
you are right maybe some how i messed up when i first registered? delete idaddy keep itdaddy; sorry for about the mess up ! i am half blind and maybe i messed up; it looks like i messed up; thanks sorry
|
Top
|
|
|
|
#171844 - 2006-12-20 10:44 PM
Re: @error handling? and redirection to a text file (append)
[Re: NTDOC]
|
Anonymous
Anonymous
Unregistered
|
yes they are both mine becu is my work and charter is my home delete idaddy yeah that is me; i must have some how register from work and home sorry just keep itdaddy at the charter.net thanks sorry for bing a cluts! my bad!
|
Top
|
|
|
|
#171849 - 2006-12-21 01:36 AM
Re: @error handling? and redirection to a text file (append)
[Re: itdaddy]
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Why do you Shell for things that can be native KiXtart? Why map to Z: if yo can also copy to an UNC style path?
If NOT @LOGONMODE
Break On
EndIf
Dim $FourthAveArray, $Element
$FourthAveArray = "ftran1", "ftran2", "ftran3"
For Each $Element In $FourthAveArray
Copy "C:\fspcopy\*.mdb" "\\" + $Element + "\c$\fsp\mdb" /c /h /r
;? @TIME ;Why display the time?
Next
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 700 anonymous users online.
|
|
|