Looking for the best ways/arguments to do the following operations in KiXtart..
1. Getting a major file version
Short version
code:
$RegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE"
$outmaj = SUBSTR((GETFILEVERSION(READVALUE($RegKey,""))), 1, (INSTR(GETFILEVERSION(READVALUE($RegKey,"")), ".")-1))
?$outmaj
Long version
code:
$RegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE"
$outver = (GETFILEVERSION(READVALUE($RegKey,"")))
$pos = (INSTR(GETFILEVERSION(READVALUE($RegKey,"")), ".")-1)
$outmaj = SUBSTR($outver, 1, $pos)
?$outmaj
2. Check for Existence of direcotry
Option one, look for the attributes
code:
IF GetFileAttr( "C:\ScriptTest" ) & 16
ELSE
MD "C:\ScriptTest"
ENDIF
Using EXIST to test for a folder
code:
IF (EXIST("C:\ScriptTest\nul") <> 1)
MD "C:\ScriptTest"
ENDIF
3. Look for a file existence
Option 1
code:
IF EXIST("C:\ScriptTest\Program.exe")
ELSE
COPY @LSERVER+"Programs\Program.exe" "C:\ScriptTest"
ENDIF
Option 2
code:
IF (1 <> EXIST("C:\ScriptTest\Program.exe"))
COPY @LSERVER+"Programs\Program.exe" "C:\ScriptTest"
ENDIF
Option 3
code:
IF (EXIST("C:\ScriptTest\Program") <> 1)
COPY @LSERVER+"Programs\Program.exe" "C:\ScriptTest"
ENDIF
Thanks,
Kent
[ 20. October 2002, 08:06: Message edited by: kdyer ]