Page 1 of 1 1
Topic Options
#42481 - 2003-07-06 01:54 PM %userdomain%
Grutte Pier Offline
Getting the hang of it

Registered: 2001-10-06
Posts: 52
Loc: Leeuwarden, The Netherlands
Hello,

I am using %userdomain% in a find and replace script. I try to change the value that holds the MAC address into "%userdomain%" but kixtart changes it into my workstation name. It should be "%userdomain%".

Is there a way to prevent kixtart from doing this?

Thanks,

Frans Erich

Top
#42482 - 2003-07-06 02:28 PM Re: %userdomain%
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Please post your code.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#42483 - 2003-07-06 02:40 PM Re: %userdomain%
Grutte Pier Offline
Getting the hang of it

Registered: 2001-10-06
Posts: 52
Loc: Leeuwarden, The Netherlands
his is the code:
code:
Break ON CLS
$Printername="HPLJ4000N"
$IniFile="D:\Kixtart\test.axt"
$oldstr4=@ADDRESS
$newstr4="%userdomain%"
$tmpfile="%temp%\tmpfile.$$$"
If Exist($IniFile)
Del $tmpfile
$nul=Open(1,$Inifile)
$nul=Open(2,$tmpfile,5)
$line=ReadLine(1)
While @ERROR=0
If InStr($line,$oldstr4)
$line=SubStr($line,1,InStr($line,$oldstr4)-1)+$newstr4+SubStr($line,InStr($line,$oldstr4)+Len($oldstr4),Len($line))
EndIf
$nul=WriteLine(2,$line+Chr(13)+Chr(10))
$line=ReadLine(1)
Loop
$nul=Close(1)
$nul=Close(2)
Del $Inifile
Copy $tmpfile $Inifile
Del $tmpfile

Thanks,

Frans Erich

Added code tags (Bullock)

[ 06. July 2003, 14:43: Message edited by: Howard Bullock ]

Top
#42484 - 2003-07-06 02:49 PM Re: %userdomain%
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Do you have the network and domain available while you are testing or are you at home logging on with cached credentials? Without the network available your logon domain is indeed your computer.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#42485 - 2003-07-06 02:52 PM Re: %userdomain%
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Incidentally, did you see my RegExp post? It was prompted by your request to remove trailing numbers in your file e.g. [Registry Value Create1]

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=004454
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#42486 - 2003-07-06 07:03 PM Re: %userdomain%
Grutte Pier Offline
Getting the hang of it

Registered: 2001-10-06
Posts: 52
Loc: Leeuwarden, The Netherlands
Yes Howard,

I saw your RegExp post but don't understand it. It is a little to complex for me to understand How can I tune it to make it work for me?

And in your posting you wrote "Added code tags (Bullock)" I tried to place them but did not work.

Thanks,

Frans

Top
#42487 - 2003-07-07 03:41 AM Re: %userdomain%
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Code tags are used like so...



[code]
 
Your code here...
 
[/code]


Top
#42488 - 2003-07-07 08:32 AM Re: %userdomain%
Grutte Pier Offline
Getting the hang of it

Registered: 2001-10-06
Posts: 52
Loc: Leeuwarden, The Netherlands
Ok now I understand.

Howard This problem has nothing to do with an network connection. I like to have in the ini file:

%userdomain%

instead of the wordstation name or userdomain.

Then this ini file will we send to workstations over the network and there applications will read it and translate %userdomain% into there userdomain.

Thanks,

Frans

Top
#42489 - 2003-07-07 08:39 AM Re: %userdomain%
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
% is reserved char.
so if you want to keep it untranslated you need to double it up.

so, if you want to write to ini, use:
%%userdomain%%

{edit}
btw, this is descriped in manual [Wink]

[ 07. July 2003, 08:39: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#42490 - 2003-07-07 03:07 PM Re: %userdomain%
Grutte Pier Offline
Getting the hang of it

Registered: 2001-10-06
Posts: 52
Loc: Leeuwarden, The Netherlands
Thanks Lonkero,

Thats it it is working now.

Thanks,

Frans Erich

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 242 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.066 seconds in which 0.026 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