Page 1 of 1 1
Topic Options
#111635 - 2004-01-12 08:38 PM {pfftt} {pfftt} is this on?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Waddup? Is there a holiday I missed?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#111636 - 2004-01-12 08:44 PM Re: {pfftt} {pfftt} is this on?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
"I'm hearin' ya" Just a quiet day, maybe everyone is busy with more boring work!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#111637 - 2004-01-12 09:38 PM Re: {pfftt} {pfftt} is this on?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I'm just watching "thirteen day's" from telly...again...
damn how americano's are silly.
_________________________
!

download KiXnet

Top
#111638 - 2004-01-14 03:24 AM Re: {pfftt} {pfftt} is this on?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
It has been quite slow around here as of late. Ive been sitting at home sick with hardly any new posts to read on here.
Top
#111639 - 2004-01-14 07:16 AM Re: {pfftt} {pfftt} is this on?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Then someone must post a challenge...

MMMM, You know my task-scheduler script... I want some windows in it which you can use to fill in starttime, timedifference, date, type, computername(s), command and parameters. something like Winat

I never had the need to use a Kixtart Gui-mode. Since this script and a few others I have. So I'm a complete newbie with Kixforms. Since a while I'm orientating myself on it. I watched some code here at Korg and at www.Kixforms.com to learn the commands and the way you have to build a form.

So for me this is a big challenge...
_________________________
Co


Top
#111640 - 2004-01-14 08:14 AM Re: {pfftt} {pfftt} is this on?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Glenn Barnes already posted some GUI AT stuff I thought.
Top
#111641 - 2004-01-14 08:56 AM Re: {pfftt} {pfftt} is this on?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Sh@#$$t! You have eliminated my challenge
_________________________
Co


Top
#111642 - 2004-01-14 10:37 AM Re: {pfftt} {pfftt} is this on?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
There is still nothing new on this board...

Hello is there anybody!!!
_________________________
Co


Top
#111643 - 2004-01-14 01:47 PM Re: {pfftt} {pfftt} is this on?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
How about this?
tsAdm package - a GUI task scheduler via KixForms

It looks like this:


You can completely control tasks on any system where you have admin perms, and even copy task events between systems.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#111644 - 2004-01-14 02:04 PM Re: {pfftt} {pfftt} is this on?
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
How about something with kixforms that allows you to put out of office replys on for users by simply entering mailbox name?

That would be a challenging challenge!!
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#111645 - 2004-01-14 04:08 PM Re: {pfftt} {pfftt} is this on?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Glenn,

Very nice.. but I want a bit more... The script i created puts several computers in an array. Every computer starts the same command but at a different time. For example every 30minutes. ScheduleTask - Array problem
Code:

;Schedule a task on multiple computers
;
;
;Dependencies: UDF's: Scheduletask, Serialtime, DateMath, SerialDate, abs.
; Domain Scan and OS filter ; Netview2, Osid (Both UDF's aren't included in this script)
; Service: Task Scheduler must be installed and running.
; Tools: Jt.exe
Break On

; Calling UDF's
;--------------
;Call "@ScriptDir\UDF\Scheduletask.udf"
;Call "@ScriptDir\UDF\Serialtime.udf"
;Call "@ScriptDir\UDF\DateMath.udf"
;Call "@ScriptDir\UDF\SerialDate.udf"
;Call "@ScriptDir\UDF\abs.udf"
;Call "@ScriptDir\UDF\Netview2.udf"
;Call "@ScriptDir\UDF\Osid.udf"

; variables
;----------
Dim $computers, $comp, $name, $date, $type, $cmd, $timediff, $time, $rc


$name='test'
$date=@date ; '2003/12/31'
$type='ONCE'
$cmd='notepad'
$timediff='00:30'
$time='23:29'
$starthour=Split($time,':')[0]

; Domain scan
;------------------------------
;
;$computers=netview2(Domain)
;
$computers = 'comp1','comp2','comp3','comp4','comp5','comp6'; etc
For Each $comp In $computers

; filter
;------------------------------
;$os = osid($comp)
;
;If $os[1]='Win2K' AND $os[2]<>'Workstation' AND InStr($comp,"comp")<>0


; Date Format
;------------
;$d = Split($date,'/')[1] + '/' + Split($date,'/')[2] + '/' + Split($date,'/')[0]

; Date /Time
;------------------------------
$time=serialtime(serialtime($time)+serialtime($timediff))
$day=Val(Split($time,':')[0])
$hour=Split($time,':')[1]
$minute=Split($time,':')[2]
$time=$hour+':'+$minute
If $time='24:00'
$time='00:00'
$date=DateMath($date, 1)
EndIf
If $day>0
$date=DateMath($date, $day)
EndIf

; Schedule Task
;------------------------------

?''
$tsk='\\server1\log$\'+$comp+'.txt'
? 'Task will be scheduled on '+$comp+' on '+$date+' at '+$time
$rc=scheduletask($name, $comp, $date, $time, $type, $cmd)
? 'Error '+@ERROR+' - '+@SERROR
Shell "%COMSPEC% /e:1024 /c schtasks /query /S "+$comp+" > "+$tsk
; jt gives an error. Schtasks shows Tasks scheduled on Windows XP and 2000
? 'Error '+@ERROR+' - '+@SERROR
Next


Exit


;UDF'S
;-----

;Function serialtime
;-------------------
Function serialtime($strtime)
Dim $day,$days,$hours, $minutes, $seconds, $milliseconds
If InStr($strtime,':')
$strtime=Split($strtime,':')
Select
Case Ubound($strtime)<3
ReDim preserve $strtime[3]
If InStr($strtime[2],'.')
$strtime[3]=Right($strtime[2],Len($strtime[2])-InStr($strtime[2],'.'))
$strtime[2]=Left($strtime[2],InStr($strtime[2],'.')-1)
Else
$strtime[3]=0
EndIf
Case Ubound($strtime)>3
$serialtime=-1
Exit 87
EndSelect
$hours=Val($strtime[0])
If $hours>23
$days=Val($hours/24)
For $day=1 to $days
$hours=$hours-24
Next
Else
$days=0
EndIf
If $hours<0
$serialtime=-1
Exit 87
EndIf
$minutes=Val($strtime[1])
If $minutes<0 OR $minutes>59
$serialtime=-1
Exit 87
EndIf
$seconds=Val($strtime[2])
If $seconds<0 OR $seconds>59
$serialtime=-1
Exit 87
EndIf
$milliseconds=CDbl($strtime[3])
If $milliseconds<0 OR $milliseconds>999
$serialtime=-1
Exit 87
EndIf
$serialtime=0.0+($days*86400)+($hours*3600)+($minutes*60)+($seconds)+($milliseconds/1000)
Else
$strtime=Val(CDbl($strtime)*1000)
If $strtime>=0
If $strtime>86400000
$days=$strtime/86400000
For $day=1 to $days
$strtime=$strtime-86400000
Next
If Len($days)<2
$days=Right('00'+$days,2)
EndIf
Else
$days='00'
EndIf
$hours=$strtime/3600/1000
$strtime=$strtime-($hours*3600*1000)
$hours=Right('00'+$hours,2)
$minutes=$strtime/60/1000
$strtime=$strtime-($minutes*60*1000)
$minutes=Right('00'+$minutes,2)
$seconds=$strtime/1000
$strtime=$strtime-($seconds*1000)
$seconds=Right('00'+$seconds,2)
$milliseconds=Left($strtime,3)
$milliseconds=Right('000'+$milliseconds,3)
$serialtime=$days+':'+$hours+':'+$minutes+':'+$seconds+'.'+$milliseconds
Else
$serialtime='-1'
Exit 87
EndIf
EndIf
EndFunction


;Function scheduletask
;---------------------
Function scheduletask($name, $comp, $date, $time, $type, $cmd, optional $prms, optional $user, optional $pw, optional $comment,
optional $typeargs, optional $jt)
Dim $jtexe[3], $shellcmd, $path

If $name='' OR $comp='' OR $date='' OR $time='' OR $type='' OR $cmd=''
Exit 87
EndIf

; create an array of potential filepaths to jt.exe
$jtexe[0]=$jt
$jtexe[1]=@STARTDIR+'\jt.exe'
$jtexe[2]=@SCRIPTDIR+'\jt.exe'
$jtexe[3]=@CURDIR+'\jt.exe'
$path=Split('%PATH%',';')
For Each $jt In $path
ReDim preserve $jtexe[Ubound($jtexe)+1]
$jtexe[Ubound($jtexe)]=Join(Split($jt+'\jt.exe','\\'),'\')
Next

; check each filepath for the presence of jt.exe
For Each $jt In $jtexe
If Exist($jt) AND NOT (GetFileAttr($jt) & 16) AND Ubound($jtexe)+1
$jtexe=$jt
EndIf
Next
Select
Case Ubound($jtexe)+1
Exit 2
Case NOT Exist($jtexe)
Exit 2
EndSelect

If Left($comp,2)<>'\\'
$comp='\\'+$comp
EndIf

If Right($name,4)<>'.job'
$name=$name+'.job'
EndIf

Select
Case $date='TODAY'
; valid format
Case Len($date)<>10
Exit 87
Case Right(Left($date,3),1)='/'
; valid format
Case Right(Left($date,5),1)='/'
; reformat date
$date=Split($date,'/')
$date=$date[1]+'/'+$date[2]+'/'+$date[0]
Case 1
Exit 87
EndSelect

; delete a potentially existing task
$shellcmd = $jtexe
If $user AND $pw
$shellcmd = $shellcmd+ ' /SC "'+$user+'" "'+$pw+'"'
EndIf
$shellcmd = $shellcmd+ ' /SM '+$comp
$shellcmd = $shellcmd+ ' /SD "'+$name+'"'

Shell '%COMSPEC% /e:1024 /c '+$shellcmd+' >NUL 2>NUL'

$shellcmd = $jtexe

If $user AND $pw
$shellcmd = $shellcmd+ ' /SC "'+$user+'" "'+$pw+'"'
EndIf

$shellcmd = $shellcmd+ ' /SM '+$comp
$shellcmd = $shellcmd+ ' /SJ ApplicationName="'+$cmd+'"'

If $prms
$shellcmd = $shellcmd+ ' Parameters="'+$prms+'"'
EndIf

$shellcmd = $shellcmd+ ' WorkingDirectory="%SYSTEMROOT%"'
$shellcmd = $shellcmd+ ' Comment="'+$comment+'"'
$shellcmd = $shellcmd+ ' Creator="'+@userid+'"'
$shellcmd = $shellcmd+ ' Priority=Normal'
$shellcmd = $shellcmd+ ' MaxRunTime=3600000'
$shellcmd = $shellcmd+ ' DontStartIfOnBatteries=0'
$shellcmd = $shellcmd+ ' KillIfGoingOnBatteries=0'
$shellcmd = $shellcmd+ ' RunOnlyIfLoggedOn=0'
$shellcmd = $shellcmd+ ' SystemRequired=0'
$shellcmd = $shellcmd+ ' DeleteWhenDone=1'
$shellcmd = $shellcmd+ ' Suspend=0'
$shellcmd = $shellcmd+ ' StartOnlyIfIdle=0'
$shellcmd = $shellcmd+ ' KillOnIdleEnd=0'
$shellcmd = $shellcmd+ ' RestartOnIdleResume=0'
$shellcmd = $shellcmd+ ' Hidden=0'
$shellcmd = $shellcmd+ ' TaskFlags=0'

$shellcmd = $shellcmd+ ' /CTJ StartDate='+$date
$shellcmd = $shellcmd+ ' StartTime='+$time
$shellcmd = $shellcmd+ ' HasEndDate=0'
$shellcmd = $shellcmd+ ' KillAtDuration=0'
$shellcmd = $shellcmd+ ' Disabled=0'
$shellcmd = $shellcmd+ ' Type='+$type
If $typeargs
$shellcmd = $shellcmd+ ' TypeArguments='+$typeargs
EndIf
$shellcmd = $shellcmd+ ' /SAJ "'+$name+'"'

Shell '%COMSPEC% /e:1024 /c '+$shellcmd+' >NUL 2>NUL'
$scheduletask=@ERROR
Exit @ERROR
EndFunction


;Function DateMath
;-----------------
Function DateMath($ExpD1,$ExpD2)
Select
Case InStr($ExpD1,'/') AND InStr($ExpD2,'/')
; two date passed - return daysbetween integer
$DateMath=serialdate($ExpD1)-serialdate($ExpD2)
If $DateMath<0
$DateMath=$DateMath*-1
EndIf
Case InStr($ExpD1,'/') AND 1-InStr($ExpD2,'/')
; date and a number passed - return date
$ExpD2=0+$ExpD2
$Datemath=serialdate(serialdate($ExpD1)+$ExpD2)
Case 1 ; incorrect parameters passed
EndSelect
EndFunction


;Function serialdate
;-------------------
Function serialdate($ExpD)
Dim $z,$h,$a,$b,$c,$y,$m,$d
If InStr($ExpD,'/')
$ExpD=Split($ExpD,'/')
$y=Val($ExpD[0])
$m=Val($ExpD[1])
$d=Val($ExpD[2])
If $m<3
$m=$m+12
$y=$y-1
EndIf
$SerialDate=$d+(153*$m-457)/5+365*$y+$y/4-$y/100+$y/400-306
Else
$z=0+$ExpD+306
$h=100*$z-25
$a=$h/3652425
$b=$a-$a/4
$y=(100*$b+$h)/36525
$c=$b+$z-365*$y-$y/4
$m=(5*$c+456)/153
$d=$c-(153*$m-457)/5
If $m>12
$y=$y+1
$m=$m-12
EndIf
$SerialDate=Right('0000'+$y,4)+'/'+Right('00'+$m,2)+'/'+Right('00'+$d,2)
EndIf
EndFunction


;FUNCTION ABS
;------------
Function abs($Expr)
;returns the absolute value of a number
$Expr=0+$Expr
If $Expr<0
$Expr=-1*$Expr
EndIf
$abs=$Expr
EndFunction


;FUNCTION OSID
;-------------
Function osid(optional $sComp)
Dim $osidarray[11]

Dim $iINWIN, $sDOS, $iBUILD, $sCSD, $iPRODUCTSUITE, $sPRODUCTTYPE


Dim $operating_system, $sp_level, $os_suite, $os_short, $productsuite
Dim $os_type, $os_role, $os_flavor, $os_subver, $regkey
Dim $os_build, $os_proc, $os_owner, $os_org, $os_key, $os_date, $os_oem
Dim $os_lang

$sComp=Trim($sComp)
Select
Case $sComp=@WKSTA
$sComp=''
Case $sComp AND NOT KeyExist('\\'+$sComp+'\HKLM')
Exit 2
Case $sComp
$sComp='\\'+$sComp+'\'
EndSelect

; fetch all macro info depending on whether it's remote or local
If $sComp
If KeyExist($sComp+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList')
$iINWIN=1
$sDOS=ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','CurrentVersion')
$iBUILD=ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','CurrentBuildNumber')
$sCSD=ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','CSDVersion')
If $sDOS='4.0' AND ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\Q246009','Installed')
$sCSD=$sCSD+'a'
EndIf
$sPRODUCTTYPE=ReadValue($sComp+'HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions',
'ProductType')
Select
Case $sPRODUCTTYPE='WinNT'
If $sDOS='4.0'
$sPRODUCTTYPE='Workstation'
Else
$sPRODUCTTYPE='Professional'
EndIf
Case $sPRODUCTTYPE='ServerNT'
If $sDOS='5.2'
$sPRODUCTTYPE=''
Else
$sPRODUCTTYPE='Server'
EndIf
Case $sPRODUCTTYPE='LANManNT'
$sPRODUCTTYPE='Domain Controller'
Case 1
$sPRODUCTTYPE='Home Edition'
EndSelect
$sPRODUCTTYPE=ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','ProductName')+' '+$sPRODUCTTYPE
$sPRODUCTTYPE=Join(Split($sPRODUCTTYPE,'Microsoft'),'')
$iPRODUCTSUITE=''
$os_lang=$sComp+Join(Split(ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','SystemRoot'),':\'),'$\')+'\system32\shell32.dll'
$os_lang=GetFileVersion($os_lang,'Language')
Else
$iINWIN=2
$dDOS=ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion','VersionNumber')
$dDOS=Split($dDOS,'.')
$iBUILD=$dDOS[Ubound($dDOS)]
ReDim preserve $dDOS[1]
$sDOS=Join($dDOS,'.')
$sCSD=''
$iPRODUCTSUITE=''
$sPRODUCTTYPE=ReadValue($sComp+'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion','Version')
$os_lang=Right(''+ReadValue($sComp+'HKLM\SYSTEM\CurrentControlSet\Control\Nls\Locale',''),4)
EndIf
Else
$iINWIN=@INWIN
$sDOS=@DOS
$iBUILD=@BUILD
$sCSD=@CSD
$iPRODUCTSUITE=@PRODUCTSUITE
$sPRODUCTTYPE=@PRODUCTTYPE
$os_lang=@SYSLANG
EndIf

; set the correct registry key
If $iINWIN=1
$regkey='HKLM\Software\Microsoft\Windows NT\CurrentVersion'
Else
$regkey='HKLM\Software\Microsoft\Windows\CurrentVersion'
EndIf
If $sComp
$regkey=$sComp+$regkey
EndIf

; retrieve registered owner, organization, build, type
$os_owner=ReadValue($regkey,'RegisteredOwner')
$os_org=ReadValue($regkey,'RegisteredOrganization')
$os_proc=ReadValue($regkey,'CurrentType')
$os_build=Val($iBUILD)

Select
Case $iINWIN=1
; determine the operating system kernel
Select
Case $sDOS='6.0'
$operating_system='Windows Longhorn'
Select
Case $os_build=4015
$operating_system=$operating_system+' (Alpha Preview 3)'
Case $os_build=4008
$operating_system=$operating_system+' (Alpha Preview 2)'
Case 1
$operating_system=$operating_system+' (Alpha/Beta/RC)'
EndSelect
$os_short='WinLonghorn'
$os_key=ReadValue($regkey,'ProductID')
Case $sDOS='5.2'
$operating_system='Windows Server 2003'
$os_short='Win2K3'
$os_key=ReadValue($regkey,'ProductID')
Select
Case $os_build=3714
$operating_system=$operating_system+' (RC1)'
Case $os_build<3790
$operating_system=$operating_system+' (Alpha/Beta/RC)'
EndSelect
Case $sDOS='5.1'
$operating_system='Windows XP'
Select
Case $os_build=2250
$operating_system=$operating_system+' (Alpha)'
Case $os_build=2257
$operating_system=$operating_system+' (Alpha)'
Case $os_build=2410
$operating_system=$operating_system+' (Beta 1)'
Case $os_build=2416
$operating_system=$operating_system+' (Beta 1)'
Case $os_build=2462
$operating_system=$operating_system+' (Beta 2)'
Case $os_build=2465
$operating_system=$operating_system+' (Beta 2)'
Case $os_build=2496
$operating_system=$operating_system+' (RC1)'
Case $os_build=2505
$operating_system=$operating_system+' (RC1)'
Case $os_build=2526
$operating_system=$operating_system+' (RC2)'
Case $os_build=2542
$operating_system=$operating_system+' (RC3)'
EndSelect
$os_short='WinXP'
$os_key=ReadValue($regkey,'ProductID')
Case $sDOS='5.0'
$operating_system='Windows 2000'
Select
Case $os_build=1515
$operating_system=$operating_system+' (Beta 2)'
Case $os_build=2031
$operating_system=$operating_system+' (Beta 3)'
Case $os_build=2128
$operating_system=$operating_system+' (Beta 3 RC2)'
Case $os_build=2183
$operating_system=$operating_system+' (Beta 3)'
EndSelect
$os_short='Win2k'
$os_key=ReadValue($regkey,'ProductID')
Case $sDOS='4.0'
$operating_system='Windows NT 4.0'
$os_short='WinNT'
$os_key=ReadValue($regkey,'ProductID')
$os_key=Left($os_key,5)+'-'+SubStr($os_key,6,3)+'-'+SubStr($os_key,10,7)+'-'+Right($os_key,5)
Case 1
$operating_system='unknown'
$os_short='unknown'
EndSelect

; determine the service pack level
$sp_level=$sCSD
If InStr($sp_level,'Service Pack')
$sp_level=Split($sp_level,'Service Pack')
$sp_level=Trim($sp_level[Ubound($sp_level)])
Else
$sp_level=0
EndIf

; determine the product suite
$productsuite=Val($iPRODUCTSUITE)
$os_suite=''
If $productsuite
If $productsuite & 1
$os_suite=$os_suite+'Small Business |'
EndIf
If $productsuite & 2
$os_suite=$os_suite+'Enterprise |'
EndIf
If $productsuite & 4
$os_suite=$os_suite+'BackOffice |'
EndIf
If $productsuite & 8
$os_suite=$os_suite+'Communication Server |'
EndIf
If $productsuite & 16
$os_suite=$os_suite+'Terminal Server |'
EndIf
If $productsuite & 32
$os_suite=$os_suite+'Small Business (Restricted) |'
EndIf
If $productsuite & 64
$os_suite=$os_suite+'Embedded NT |'
EndIf
If $productsuite & 128
$os_suite=$os_suite+'DataCenter |'
EndIf
If $productsuite & 256
$os_suite=$os_suite+'Single User Terminal Server |'
EndIf
If $productsuite & 512
$os_suite=$os_suite+'Home Edition |'
EndIf
If $productsuite & 1024
$os_suite=$os_suite+'Blade Server |'
EndIf
If InStr($os_suite,'|')
$os_suite=Left($os_suite,Len($os_suite)-2)
EndIf
EndIf

; determine the producy type
$os_type=$sPRODUCTTYPE
Select
Case InStr($os_type,'Domain Controller')
$os_role='Domain Controller'
$os_flavor='Server'
Case InStr($os_type,'Server')
$os_role='Member Server'
$os_flavor='Server'
Case InStr($os_type,'Workstation')
$os_role='Workstation'
$os_flavor='Workstation'
Case InStr($os_type,'Professional')
$os_role='Workstation'
$os_flavor='Workstation'
Case InStr($os_type,'Tablet PC')
$os_role='Workstation'
$os_flavor='Tablet PC'
Case InStr($os_type,'Home Edition')
$os_role='Workstation'
$os_flavor='Workstation'
Case 1
$os_role='unknown'
$os_flavor='unknown'
EndSelect

$operating_system=$operating_system+' '+$os_flavor+' Service Pack '+$sp_level
If $os_suite<>''
$operating_system=$operating_system+' ['+$os_suite+']'
EndIf

; determine the installation date
$os_date=ReadValue('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','Installdate')

; determine the OEM Duplicator String
$os_oem=ReadValue('HKLM\System\Setup','OemDuplicatorString')

Case $iINWIN=2
$os_short='Win9x'
$os_role='Workstation'
$sp_level=0

$os_subver=Lcase(ReadValue($regkey,'SubVersionNumber'))

Select
Case $sDOS='4.90'
$operating_system='Windows ME'
$os_key=ReadValue($regkey,'ProductKey')
$os_flavor=''
Case $sDOS='4.10'
$operating_system='Windows 98'
$os_key=ReadValue($regkey,'ProductKey')
Select
Case InStr($os_subver,'c')
$os_flavor='SE'
Case InStr($os_subver,'b')
$os_flavor='B'
Case $os_subver=' a '
$os_flavor='Second Edition'
Case 1
$os_flavor='OEM'
EndSelect
Case $sDOS='4.0'
$operating_system='Windows 95'
$os_key=ReadValue($regkey,'ProductID')
Select
Case InStr($os_subver,'c')
$os_flavor='OSR 2.5'
Case InStr($os_subver,'b')
$os_flavor='OSR 2.0'
Case InStr($os_subver,'a')
$os_flavor=' Service Pack 1'
Case 1
$os_flavor=' OEM'
EndSelect
Case 1
$operating_system='unknown'
$os_short='unknown'
EndSelect

If $os_flavor
$operating_system=$operating_system+' '+$os_flavor
EndIf

EndSelect

$osidarray[0]=$operating_system
$osidarray[1]=$os_short
$osidarray[2]=$os_role
$osidarray[3]=$sp_level
$osidarray[4]=$os_build
$osidarray[5]=$os_proc
$osidarray[6]=$os_owner
$osidarray[7]=$os_org
$osidarray[8]=$os_key
$osidarray[9]=$os_date
$osidarray[10]=$os_oem
$osidarray[11]=$os_lang

$osid=$osidarray

EndFunction


;FUNCTION NetView2()
;-------------------
Function NetView2(optional $domain, optional $commentflag)
Dim $array[255]
Dim $ReDim, $i, $j, $tempfile
Dim $filehandle, $retcode, $line
Dim $name, $comment

$ReDim = 255
$i = 0
$j = 0
$tempfile = '%temp%\netview.tmp'

If $domain
$domain = '/domain:'+Trim($domain)
EndIf

If VarType($commentflag)
$commentflag=Val($commentflag)
Else
$commentflag=0
EndIf

If Exist($tempfile)
Del $tempfile
EndIf

Shell '%comspec% /c net view '+$domain+' >"'+$tempfile+'"'

If @error = 0
$filehandle=FreeFileHandle()
$retcode=Open($filehandle,$tempfile)

For $j = 1 to 5
$line = ReadLine($filehandle) ; skip headings
Next

While @error = 0
$name= Trim(SubStr($line,3,InStr($line,' ')-1))
$comment = Trim(Right($line,Len($line)-InStr($line,' ')))
If $commentflag
$array[$i]=$name+','+$comment
Else
$array[$i]=$name
EndIf
$i=$i+1
If $i = $ReDim
$ReDim=$ReDim*2
ReDim preserve $array[$ReDim]
EndIf
$line = ReadLine($filehandle)
Loop
$retcode=Close($filehandle)
Del $tempfile
If $i
ReDim preserve $array[$i-4]
$netview2 = $array
Exit @error
EndIf
EndIf

$netview2 = 0
Exit @error
EndFunction

_________________________
Co


Top
#111646 - 2004-01-14 09:07 PM Re: {pfftt} {pfftt} is this on?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Oh, no problem. You want to hack my Deploy tool.



This tool takes a list of servers and schedules a task to run (once) at the specified time. There are fields that control how many servers to schedule at one time, and what the time difference should be (if you want 1 server every 10 minutes, you'd specify a group of 1 and interval of 10)

All that would be required is to change the task definition and eliminate the extraneous fields. Of course, your ideal solution would be to merge the tsAdm tool with the deploy tool. A "quick and dirty" way to do this would be to add an EXPORT button to the tsAdm tool that would simply save the two arrays to a (INI format) file. Then, specify that file as the task for the modified Deploy tool.

I have no use for this functionality, so you're on your own if you want it.. I'll send you the Deploy code, and you can get the tsAdm code from the KixForms site.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#111647 - 2004-01-14 09:34 PM Re: {pfftt} {pfftt} is this on?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Thanks Glenn,

I need always a goal to create something otherwise there comes nothing out of my hands... Since NTDOC elimitated my first one I have now a second one. Maybe this is better... I have noticed it is easier to learn a new scripting/programming language when you start to edit someone else his code. When i'm finished or when it is one big mess I'll post the results
_________________________
Co


Top
#111648 - 2004-01-15 12:01 PM Re: {pfftt} {pfftt} is this on?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Glenn,

Please send me your Deploy code.. I'm very interested!
_________________________
Co


Top
#111649 - 2004-01-21 02:55 PM Re: {pfftt} {pfftt} is this on?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
You've got mail (and a ZIP package delivery!)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#111650 - 2004-01-22 06:05 AM Re: {pfftt} {pfftt} is this on?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Glenn,

I would be also interested in this too.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#111651 - 2004-01-22 09:48 AM Re: {pfftt} {pfftt} is this on?
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
I've received your mail.. I let you all know the results..

I'm very busy these days (At work and with some courses) So have some patience...
_________________________
Co


Top
#111652 - 2004-01-22 05:01 PM Re: {pfftt} {pfftt} is this on?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Kent:

You've got mail!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


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

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.07 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