iffy
|
(Starting to like KiXtart)
|
2005-06-16 04:26 PM
|
|
|
|
|
@ScriptDir and @ScriptName bugs in 4.50rc1
|
|
only tested with kix32.exe from KiXtart v4.50rc1
I would expect the code below to output 2 directories, but it doesn't, only the first is printed. @ScriptDir inside a function gives a blank string, same if the function is used with INCLUDE. Code:
? @ScriptDir ScriptDir_test
Function ScriptDir_test ? @ScriptDir EndFunction
it took me a fair amount of time (and curses) to figure it finally out
Update:
Try the following, not what I would have expected... Code:
? @ScriptDir ? @ScriptName ? @ScriptExe ScriptDir_test
Function ScriptDir_test ? @ScriptDir ? @ScriptName ? @ScriptExe EndFunction Gives the following output Code:
H:\Documenten sd.KIX KIX32.EXE KIX32.EXE
|
Kdyer
|
(KiX Supporter)
|
2005-06-16 04:51 PM
|
|
|
|
|
Re: @ScriptDir bug 4.50rc1
|
|
iffy is correct at least with 2a (don't have RC-1) here.
Here is a test script with the macros: Code:
CLS BREAK ON ;Test macros ?'address '+@address SLEEP '.1' ?'build '+@build SLEEP '.1' ?'color '+@color SLEEP '.1' ?'comment '+@comment SLEEP '.1' ?'cpu '+@cpu SLEEP '.1' ?'crlf '+@crlf SLEEP '.1' ?'csd '+@csd SLEEP '.1' ?'curdir '+@curdir SLEEP '.1' ?'date '+@date SLEEP '.1' ?'day '+@day SLEEP '.1' ?'domain '+@domain SLEEP '.1' ?'dos '+@dos SLEEP '.1' ?'error '+@error SLEEP '.1' ?'serror '+@serror SLEEP '.1' SLEEP '.1' ?'fullname '+@fullname SLEEP '.1' ?'homedir '+@homedir SLEEP '.1' ?'homedrive '+@homedrive SLEEP '.1' ?'homeshr '+@homeshr SLEEP '.1' ?'hostname '+@hostname SLEEP '.1' ?'inwin '+@inwin SLEEP '.1' ?'ipaddress0 '+@ipaddress0 SLEEP '.1' ?'ipaddress1 '+@ipaddress1 SLEEP '.1' ?'ipaddress2 '+@ipaddress2 SLEEP '.1' ?'ipaddress3 '+@ipaddress3 SLEEP '.1' ?'kix '+@kix SLEEP '.1' ?'lanroot '+@lanroot SLEEP '.1' ?'ldomain '+@ldomain SLEEP '.1' ?'ldrive '+@ldrive SLEEP '.1' ?'lm '+@lm SLEEP '.1' ?'logonmode '+@logonmode SLEEP '.1' ?'longhomedir '+@longhomedir SLEEP '.1' ?'lserver '+@lserver SLEEP '.1' ?'maxpwage '+@maxpwage SLEEP '.1' ?'mdayno '+@mdayno SLEEP '.1' ?'mhz '+@mhz SLEEP '.1' ?'monthno '+@monthno SLEEP '.1' ?'month '+@month SLEEP '.1' ?'msecs '+@msecs SLEEP '.1' ?'pid '+@pid SLEEP '.1' ?'primarygroup '+@primarygroup SLEEP '.1' ?'priv '+@priv SLEEP '.1' ?'productsuite '+@productsuite SLEEP '.1' ?'producttype '+@producttype SLEEP '.1' ?'pwage '+@pwage SLEEP '.1' ?'ras '+@ras SLEEP '.1' ?'result '+@result SLEEP '.1' ?'rserver '+@rserver SLEEP '.1' ?'scriptdir '+@scriptdir SLEEP '.1' ?'scriptexe '+@scriptexe SLEEP '.1' ?'scriptname '+@scriptname SLEEP '.1' ?'sid '+@sid SLEEP '.1' ?'site '+@site SLEEP '.1' ?'startdir '+@startdir SLEEP '.1' ?'syslang '+@syslang SLEEP '.1' ?'ticks '+@ticks SLEEP '.1' ?'time '+@time SLEEP '.1' ?'userid '+@userid SLEEP '.1' ?'userlang '+@userlang SLEEP '.1' ?'wdayno '+@wdayno SLEEP '.1' ?'wksta '+@wksta SLEEP '.1' ?'wuserid '+@wuserid SLEEP '.1' ?'ydayno '+@ydayno SLEEP '.1' ?'year '+@year ? ?'Process is complete.. Press a key' get $
and the result:
Quote:
address 000D9D53EBE6 build 2600 color w/n comment <COMPANY> - Network Engineering cpu Intel(R) Pentium(R) 4 CPU 3.20GHz crlf
csd Service Pack 2 curdir C:\!Kix\test date 2005/06/16 day Thursday domain RESOURCE dos 5.1 error 0 serror The operation completed successfully. fullname Kent Dyer homedir homedrive homeshr hostname <MACHINEID>.<DOMAIN>.<COMPANY>.COM inwin 1 ipaddress0 1. 1. 1. 1 ipaddress1 2. 2. 2. 2 ipaddress2 ipaddress3 kix 4.50 Beta 2a Release lanroot C:\WINDOWS\system32 ldomain RESOURCE ldrive \\THADIUS\NETLOGON\ lm 5.1 logonmode longhomedir lserver \\<LOGONSERVER> maxpwage 90 mdayno 16 mhz 3192 monthno 6 month June msecs 515 pid 660 primarygroup Domain Users priv ADMIN productsuite 256 producttype Windows XP Professional pwage 31 ras 0 result rserver scriptdir scriptexe KIX32.EXE scriptname macros.kix sid S-1-5-21-299502267-776561741-682003330-27277 site PORTLAND startdir C:\WINDOWS\system32 syslang 0409English ticks 1936890 time 07:30:55 userid KDyer userlang 0409English wdayno 4 wksta <WORKSTATION NAME> wuserid kdyer ydayno 167 year 2005
Process is complete.. Press a key
Thanks!
Kent
|
iffy
|
(Starting to like KiXtart)
|
2005-06-16 05:03 PM
|
|
|
|
|
Re: @ScriptDir bug 4.50rc1
|
|
Your example shows the problem with @ScriptDir in beta 2 discussed earlier in this topic. According to Ruud that was fixed in rc1 which my test shows.
My new issue is that both @scriptdir and @scriptname do not work inside UDF's, rewriting some stuff now but would be nice if it's fixed in the future.
|
Bryce
|
(KiX Supporter)
|
2005-06-16 05:17 PM
|
|
|
|
|
Re: @ScriptDir bug 4.50rc1
|
|
Looks like it is both @scriptdir and @scriptname when called from a function.
Quote:
scriptdir G:\kix\sandbox | scriptdir scriptname test.KIX | scriptname
Code:
CLS BREAK ON ;Test macros
DIM $marray[62] $MArray[0] = 'address '+@ADDRESS $MArray[1] = 'build '+@BUILD $MArray[2] = 'color '+@COLOR $MArray[3] = 'comment '+@COMMENT $MArray[4] = 'cpu '+@CPU $MArray[5] = 'crlf '+@CRLF $MArray[6] = 'csd '+@CSD $MArray[7] = 'curdir '+@CURDIR $MArray[8] = 'date '+@DATE $MArray[9] = 'day '+@DAY $MArray[10] = 'domain '+@DOMAIN $MArray[11] = 'dos '+@DOS $MArray[12] = 'error '+@ERROR $MArray[13] = 'serror '+@SERROR $MArray[14] = 'fullname '+@FULLNAME $MArray[15] = 'homedir '+@HOMEDIR $MArray[16] = 'homedrive '+@HOMEDRIVE $MArray[17] = 'homeshr '+@HOMESHR $MArray[18] = 'hostname '+@HOSTNAME $MArray[19] = 'inwin '+@INWIN $MArray[20] = 'ipaddress0 '+@IPADDRESS0 $MArray[21] = 'ipaddress1 '+@IPADDRESS1 $MArray[22] = 'ipaddress2 '+@IPADDRESS2 $MArray[23] = 'ipaddress3 '+@IPADDRESS3 $MArray[24] = 'kix '+@KIX $MArray[25] = 'lanroot '+@LANROOT $MArray[26] = 'ldomain '+@LDOMAIN $MArray[27] = 'ldrive '+@LDRIVE $MArray[28] = 'lm '+@LM $MArray[29] = 'logonmode '+@LOGONMODE $MArray[30] = 'longhomedir '+@LONGHOMEDIR $MArray[31] = 'lserver '+@LSERVER $MArray[32] = 'maxpwage '+@MAXPWAGE $MArray[33] = 'mdayno '+@MDAYNO $MArray[34] = 'mhz '+@MHZ $MArray[35] = 'monthno '+@MONTHNO $MArray[36] = 'month '+@MONTH $MArray[37] = 'msecs '+@MSECS $MArray[38] = 'pid '+@PID $MArray[39] = 'primarygroup '+@PRIMARYGROUP $MArray[40] = 'priv '+@PRIV $MArray[41] = 'productsuite '+@PRODUCTSUITE $MArray[42] = 'producttype '+@PRODUCTTYPE $MArray[43] = 'pwage '+@PWAGE $MArray[44] = 'ras '+@RAS $MArray[45] = 'result '+@RESULT $MArray[46] = 'rserver '+@RSERVER $MArray[47] = 'scriptdir '+@SCRIPTDIR $MArray[48] = 'scriptexe '+@SCRIPTEXE $MArray[49] = 'scriptname '+@SCRIPTNAME $MArray[50] = 'sid '+@SID $MArray[51] = 'site '+@SITE $MArray[52] = 'startdir '+@STARTDIR $MArray[53] = 'syslang '+@SYSLANG $MArray[54] = 'ticks '+@TICKS $MArray[55] = 'time '+@TIME $MArray[56] = 'userid '+@USERID $MArray[57] = 'userlang '+@USERLANG $MArray[58] = 'wdayno '+@WDAYNO $MArray[59] = 'wksta '+@WKSTA $MArray[60] = 'wuserid '+@WUSERID $MArray[61] = 'ydayno '+@YDAYNO $MArray[62] = 'year '+@YEAR
$marray2 = TM
For $i = 0 To UBound($marray) If $marray[$i] <> $marray2[$i] ? $marray[$i] " | " $marray2[$i] EndIf Next
Function TM DIM $marray[62] $MArray[0] = 'address '+@ADDRESS $MArray[1] = 'build '+@BUILD $MArray[2] = 'color '+@COLOR $MArray[3] = 'comment '+@COMMENT $MArray[4] = 'cpu '+@CPU $MArray[5] = 'crlf '+@CRLF $MArray[6] = 'csd '+@CSD $MArray[7] = 'curdir '+@CURDIR $MArray[8] = 'date '+@DATE $MArray[9] = 'day '+@DAY $MArray[10] = 'domain '+@DOMAIN $MArray[11] = 'dos '+@DOS $MArray[12] = 'error '+@ERROR $MArray[13] = 'serror '+@SERROR $MArray[14] = 'fullname '+@FULLNAME $MArray[15] = 'homedir '+@HOMEDIR $MArray[16] = 'homedrive '+@HOMEDRIVE $MArray[17] = 'homeshr '+@HOMESHR $MArray[18] = 'hostname '+@HOSTNAME $MArray[19] = 'inwin '+@INWIN $MArray[20] = 'ipaddress0 '+@IPADDRESS0 $MArray[21] = 'ipaddress1 '+@IPADDRESS1 $MArray[22] = 'ipaddress2 '+@IPADDRESS2 $MArray[23] = 'ipaddress3 '+@IPADDRESS3 $MArray[24] = 'kix '+@KIX $MArray[25] = 'lanroot '+@LANROOT $MArray[26] = 'ldomain '+@LDOMAIN $MArray[27] = 'ldrive '+@LDRIVE $MArray[28] = 'lm '+@LM $MArray[29] = 'logonmode '+@LOGONMODE $MArray[30] = 'longhomedir '+@LONGHOMEDIR $MArray[31] = 'lserver '+@LSERVER $MArray[32] = 'maxpwage '+@MAXPWAGE $MArray[33] = 'mdayno '+@MDAYNO $MArray[34] = 'mhz '+@MHZ $MArray[35] = 'monthno '+@MONTHNO $MArray[36] = 'month '+@MONTH $MArray[37] = 'msecs '+@MSECS $MArray[38] = 'pid '+@PID $MArray[39] = 'primarygroup '+@PRIMARYGROUP $MArray[40] = 'priv '+@PRIV $MArray[41] = 'productsuite '+@PRODUCTSUITE $MArray[42] = 'producttype '+@PRODUCTTYPE $MArray[43] = 'pwage '+@PWAGE $MArray[44] = 'ras '+@RAS $MArray[45] = 'result '+@RESULT $MArray[46] = 'rserver '+@RSERVER $MArray[47] = 'scriptdir '+@SCRIPTDIR $MArray[48] = 'scriptexe '+@SCRIPTEXE $MArray[49] = 'scriptname '+@SCRIPTNAME $MArray[50] = 'sid '+@SID $MArray[51] = 'site '+@SITE $MArray[52] = 'startdir '+@STARTDIR $MArray[53] = 'syslang '+@SYSLANG $MArray[54] = 'ticks '+@TICKS $MArray[55] = 'time '+@TIME $MArray[56] = 'userid '+@USERID $MArray[57] = 'userlang '+@USERLANG $MArray[58] = 'wdayno '+@WDAYNO $MArray[59] = 'wksta '+@WKSTA $MArray[60] = 'wuserid '+@WUSERID $MArray[61] = 'ydayno '+@YDAYNO $MArray[62] = 'year '+@YEAR $tm = $marray EndFunction
|
NTDOC
|
(KiX Master)
|
2005-06-17 04:36 AM
|
|
|
|
|
Re: @ScriptDir and @ScriptName bugs in 4.50rc1
|
|
Confirmed latest private build of KiXtart 4.5RC1B does not have this issue.
Code:
Break On 'ScriptDir: ' + @ScriptDir ? 'Script Name: ' + @ScriptName ? 'Script EXE: ' + @ScriptExe ? ScriptDir_test() Function ScriptDir_test() 'From UDF ScriptDir: ' + @ScriptDir ? 'From UDF Script Name: ' + @ScriptName ? 'From UDF Script EXE: ' + @ScriptExe ? EndFunction
Quote:
ScriptDir: C:\AD Script Name: TEST45.KIX Script EXE: KIX32.EXE From UDF ScriptDir: C:\AD From UDF Script Name: TEST45.KIX From UDF Script EXE: KIX32.EXE
|
NTDOC
|
(KiX Master)
|
2005-06-17 04:41 AM
|
|
|
|
|
Re: @ScriptDir bug 4.50rc1
|
|
Not sure what I was supposed to get here Bryce...
Code:
msecs 890 | msecs 968 ticks 3406515 | ticks 3406531
|
NTDOC
|
(KiX Master)
|
2005-06-17 04:44 AM
|
|
|
|
|
Re: @ScriptDir bug 4.50rc1
|
|
No problem with latest version Kent
scriptdir C:\AD scriptexe KIX32.EXE scriptname KentTest45.kix sid S-1-5-21-1343024091-963894560-839522115-1003
|
Kdyer
|
(KiX Supporter)
|
2005-06-17 06:52 AM
|
|
|
|
|
Re: @ScriptDir bug 4.50rc1
|
|
Thanks Doc!
Works here too:
Quote:
Kix: 4.50 ScriptDir: C:\Documents and Settings\Kent\KiX2010.450 Script Name: scriptdir.KIX Script EXE: KIX32.EXE From UDF ScriptDir: C:\Documents and Settings\Kent\KiX2010.450 From UDF Script Name: scriptdir.KIX From UDF Script EXE: KIX32.EXE
If you want to test with the various script components: Test Scripts - Continued
Kent
|