#205051 - 2012-04-30 06:01 PM
Windows 7 issue?? Unable to Call another script?
|
andrewwarduk
Just in Town
Registered: 2005-11-04
Posts: 2
Loc: uk
|
I am trying to get Kix to call another script for Windows 7 machines only. It seems that Windows 7 is ignoring the Call, Shell and run commands? on both x64 and x32. I have disabled UAC so its not causing the issue.
Is anyone else having the same problem, I was wondering if this is similar to the Ifingroup bug? BTW I have also tried Kix 4.61 to no avail????
The write value is working and that is being applied to everything other than windows 7
; The following registry settings need to be applied to all PC's on the network
If @PRODUCTTYPE = "Windows 2000 Server" GoTo "notsupported"
Else If @PRODUCTTYPE = "Windows 95" GoTo "notsupported"
Else If @PRODUCTTYPE = "Windows Server 2003" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows Server 2003 Domain Controller" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows Server 2003 R2" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows Server 2003 R2 Domain Controller" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows Vista" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows Server 2003 R2 Domain Controller" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows 98" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows Me" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows NT Workstation" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows NT Server" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows NT Domain Controller" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows 2000 Professional" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows 2000 Domain Controller" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows XP Home Edition" GoTo "runscript"
Else If @PRODUCTTYPE = "Windows XP Professional" GoTo "runscript"
;For some reason this is failing to run on Win7 x32 and x64 I have also tried running as shell and run? key.bat resides in netlogon.
CALL @LDRIVE + "\Key.bat"
EndIf
:runscript
WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\AssetCTRL", "Test", "1001", "REG_DWORD")
Endif
:notsupported
EndIf
Key.bat contains
REG ADD HKLM\software\AssetCTRL /v Test /t REG_DWORD /d 1001 /F
pause
Edited by Mart (2012-05-01 10:35 AM) Edit Reason: Please use code tags when posting code.
|
|
Top
|
|
|
|
#205053 - 2012-04-30 07:09 PM
Re: Windows 7 issue?? Unable to Call another script?
[Re: andrewwarduk]
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
If probably has more to do with all your mismatched If/Else/EndIf statements.
You have 17 IF statements, and only 3 EndIf statements.
This should accomplish the same thing...without using the dreaded GoTos.
; The following registry settings need to be applied to all PC's on the network
If InStr(@PRODUCTTYPE,"Server 2003") OR
InStr(@PRODUCTTYPE,"Vista") OR
InStr(@PRODUCTTYPE,"98") OR
InStr(@PRODUCTTYPE,"Me") OR
InStr(@PRODUCTTYPE,"NT") OR
InStr(@PRODUCTTYPE,"2000 Professional") OR
InStr(@PRODUCTTYPE,"2000 Domain") OR
InStr(@PRODUCTTYPE,"XP")
$nul = WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\AssetCTRL", "Test", "1001", "REG_DWORD")
Else
If @PRODUCTTYPE <> "Windows 2000 Server" AND @PRODUCTTYPE <> "Windows 95"
CALL @LDRIVE + "\Key.bat"
Endif
Endif
|
|
Top
|
|
|
|
#205055 - 2012-04-30 08:41 PM
Re: Windows 7 issue?? Unable to Call another script?
[Re: Allen]
|
andrewwarduk
Just in Town
Registered: 2005-11-04
Posts: 2
Loc: uk
|
So i take it i need an EndIf after each if statement? sorry im a noobe to Kix
|
|
Top
|
|
|
|
#205073 - 2012-05-01 02:20 PM
Re: Windows 7 issue?? Unable to Call another script?
[Re: Lonkero]
|
BradV
Seasoned Scripter
  
Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
|
Sorry, I should have looked back to the original post.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 793 anonymous users online.
|
|
|