#179282 - 2007-08-14 05:05 PM
Verification of script running or errors
|
John45
Fresh Scripter
Registered: 2007-08-10
Posts: 8
|
Ok in my script which is done via KiXtart I have the following command
run "cscript \\server\netlogon\xxx.vbs"
My script runs and i get all my other mappings. The issue i have is that the screen comes up and flashes so fast i dont know if its registering an error or just procesing smoothly.
Whats my best way to check this ?
Edited by John45 (2007-08-14 05:06 PM)
|
|
Top
|
|
|
|
#179330 - 2007-08-15 12:31 PM
Re: Verification of script running or errors
[Re: Witto]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
You would think - eh?
The environment I inherited recently had 130+ bat files, 130+ kix files (calling additional VBS scripts) and somewhere around 40 VBS scripts. Even worse, some kix scripts called 3 separate VBS scripts, which each mapped one drive. All of this to support the login process! One of the most bizzare things I've seen in the technology world.
Can anyone guess how many .KIx and .VBS scripts are present today? 
As for your issue, a sleep called from your VBS would work, but not from within Kix (the window would open/shut, then kix would wait). Richard had the best idea for troubleshooting - don't run the .VBS script from kix (even temporarily). Alter a copy of your login scrip to run SHELL '%COMSPEC%' - kix will pop open a command prompt and wait for YOU to close it.
Modify your account to run the modified login script, then log in. Run the VBS script manually when the command window opens - check the results, and type EXIT - the kix script will continue. This way, you can closely control the actual process of the login script, during login time.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
#179334 - 2007-08-15 01:07 PM
Re: Verification of script running or errors
[Re: Björn]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
Convert all VBS files to kix functions :P KORG - VBS WILL be Assimilated!
|
|
Top
|
|
|
|
#179345 - 2007-08-15 03:18 PM
Re: Verification of script running or errors
[Re: Witto]
|
John45
Fresh Scripter
Registered: 2007-08-10
Posts: 8
|
Im not using the VBS to map drives..all the drive mappings happen in the KiX code..The vbs is a recent add on that Im using to set some registry values and disable some check boxes in IE.
|
|
Top
|
|
|
|
#179346 - 2007-08-15 03:20 PM
Re: Verification of script running or errors
[Re: Glenn Barnas]
|
John45
Fresh Scripter
Registered: 2007-08-10
Posts: 8
|
Thanks for the advice everyone, ill make some changes today and see what I come up with.
I appreciate all the feedback, im sorry asked something that should be found in the FAQ; ill dig more before i post next time.
|
|
Top
|
|
|
|
#179411 - 2007-08-16 10:33 PM
Re: Verification of script running or errors
[Re: NTDOC]
|
John45
Fresh Scripter
Registered: 2007-08-10
Posts: 8
|
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
Dim strValue
strValue = ""
'Determine most recent installed version of Java
strKeyPath = "SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\JAVA_SUN\SELECT"
strValueName = "RegPath"
oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
'Wscript.Echo strValue 'something like Software\JavaSoft\Java Plug-in\1.6.0_02
'Set values for most recent version
If strValue <> "" Then
strKeyPath = strValue
strValueName = "UseJava2IExplorer"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
strValueName = "HideSystemTrayIcon"
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
End If
'Set values for java versions on the standard desktop image
'Version 1.3.1_15
strKeyPath = "SOFTWARE\JavaSoft\Java Plug-in\1.3.1_15"
strValueName = "UseJava2IExplorer"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
'Version 1.4.2_07
strKeyPath = "SOFTWARE\JavaSoft\Java Plug-in\1.4.2_07"
strValueName = "UseJava2IExplorer"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
strValueName = "HideSystemTrayIcon"
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
'Version 1.5.0_01
strKeyPath = "SOFTWARE\JavaSoft\Java Plug-in\1.5.0_01"
strValueName = "UseJava2IExplorer"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
strValueName = "HideSystemTrayIcon"
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
'Disable Java Automatic Updates
strKeyPath = "SOFTWARE\JavaSoft\Java Update\Policy"
strValueName = "EnableJavaUpdate"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
strValueName = "EnableAutoUpdateCheck"
oReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
|
|
Top
|
|
|
|
#179413 - 2007-08-17 04:11 AM
Re: Verification of script running or errors
[Re: John45]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Well in general no sense in checking the value, just set it. But we can if you like.
Something like this (untested code)
Dim $JPath, $WV $JPath = 'HKLM\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\JAVA_SUN\SELECT' $WV = WriteValue($JPath,'UseJava2IExplorer',0,REG_DWORD) $WV = WriteValue($JPath,'HideSystemTrayIcon',1,REG_DWORD) $WV = WriteValue('HKLM\SOFTWARE\JavaSoft\Java Plug-in\1.3.1_15','UseJava2IExplorer',0,REG_DWORD) $WV = WriteValue('HKLM\SOFTWARE\JavaSoft\Java Plug-in\1.4.2_07','UseJava2IExplorer',0,REG_DWORD) $WV = WriteValue('HKLM\SOFTWARE\JavaSoft\Java Plug-in\1.4.2_07','HideSystemTrayIcon',1,REG_DWORD) $WV = WriteValue('HKLM\SOFTWARE\JavaSoft\Java Plug-in\1.5.0_01','UseJava2IExplorer',0,REG_DWORD) $WV = WriteValue('HKLM\SOFTWARE\JavaSoft\Java Plug-in\1.5.0_01','HideSystemTrayIcon',1,REG_DWORD) $WV = WriteValue('HKLM\SOFTWARE\JavaSoft\Java Update\Policy','EnableJavaUpdate',0,REG_DWORD) $WV = WriteValue('HKLM\SOFTWARE\JavaSoft\Java Update\Policy','EnableAutoUpdateCheck',0,REG_DWORD)
A user would need to be a local admin to run this though or we could also code it so it could be run from your workstation against all the remote computers if wanted.
|
|
Top
|
|
|
|
#179591 - 2007-08-22 07:26 PM
Re: Verification of script running or errors
[Re: NTDOC]
|
John45
Fresh Scripter
Registered: 2007-08-10
Posts: 8
|
Thanks for all the help, coding and advice !
We are going through our testing this week so ill post up what i ended up using once i verify it does everything i wanted.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 484 anonymous users online.
|
|
|