Page 1 of 1 1
Topic Options
#128201 - 2004-10-20 10:42 PM redirectoutput
Anonymous
Unregistered


i can not seem to the the redirect to work i can get all the info i want but i can not get it to a file

code:
=================================================
Use M: "\\cpierce\errorlog"

; 1) Basic computer info for reference

ReDirectOutput ("M:\Inventory\@WKSTA.txt",1)

?"NetBIOS name = "@WKSTA

?"Last login by "@USERID

?"OS = "@PRODUCTTYPE" with "@CSD

?"Memory = "MemorySize(0)" MB"

?"Processor type is "@CPU

?"Processor speed is "@MHZ

?"IP address = "@IPADDRESS0

?"MAC address = "@ADDRESS

?"This information was gathered on "@DATE" at "@TIME

=======================================================

Top
#128202 - 2004-10-20 10:46 PM Re: redirectoutput
Anonymous
Unregistered


sorry for not using the [CODE] [/CODE] in the post

Quote:

i can not seem to the the redirect to work i can get all the info i want but i can not get it to a file

code:
=================================================
Use M: "\\cpierce\errorlog"

; 1) Basic computer info for reference

ReDirectOutput ("M:\Inventory\@WKSTA.txt",1)

?"NetBIOS name = "@WKSTA

?"Last login by "@USERID

?"OS = "@PRODUCTTYPE" with "@CSD

?"Memory = "MemorySize(0)" MB"

?"Processor type is "@CPU

?"Processor speed is "@MHZ

?"IP address = "@IPADDRESS0

?"MAC address = "@ADDRESS

?"This information was gathered on "@DATE" at "@TIME

=======================================================




Top
#128203 - 2004-10-20 11:04 PM Re: redirectoutput
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well..
what is the problem you have?

anyways, you should change this:
ReDirectOutput ("M:\Inventory\@WKSTA.txt",1)

to:
$nul= ReDirectOutput ("M:\Inventory\"+@WKSTA+".txt",1)

for certainty.
vars and macro's inside strings are risky...
_________________________
!

download KiXnet

Top
#128204 - 2004-10-21 12:29 AM Re: redirectoutput
Anonymous
Unregistered


the problem i am having is the file is not getting created on the mapped drive, isee the output in the command window but no file gets created.

the
$nul= ReDirectOutput ("M:\Inventory\"+@WKSTA+".txt",1)
confuses me what do i need a var for. yes i am new to this so please be nice

Top
#128205 - 2004-10-21 01:22 AM Re: redirectoutput
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
What's the error code being returned by REDIRECTOUTPUT? Read the KiXtart Manual for debugging info.
_________________________
There are two types of vessels, submarines and targets.

Top
#128206 - 2004-10-21 01:26 AM Re: redirectoutput
Les Offline
KiX Master
*****

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

isee the output in the command window ...



Then the function obviously is not working or else you would not see the output.

There are FAQs that explain the proper use of RedirectOutput and the purpose of the var.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#128207 - 2004-10-21 10:56 AM Re: redirectoutput
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Probably M:\Inventory does not exist or you cannot create a file in it. Or the ".txt" file does exist and you don't have permissions to write to it.

Try the following, it will display an error message if there is a problem:
Code:
$nul= ReDirectOutput ("M:\Inventory\"+@WKSTA+".txt",1)
If @ERROR "Redirect error ["+@ERROR+"] "+@SERROR+@CRLF EndIf


Top
#128208 - 2004-10-21 11:06 AM Re: redirectoutput
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Please logon to KiXtart.org so that your name shows.

Are you using KIX32.EXE or WKIX32.EXE ?
What version of KiXtart are you using ?
What client versions do you support 9x/NT/2000/XP/2003 ?

Top
#128209 - 2004-10-21 02:53 PM Re: redirectoutput
Les Offline
KiX Master
*****

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

Please logon to KiXtart.org so that your name shows.




I think there is a fear of commitment so he has not yet been assimilated into the korg collective.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 987 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.056 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

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