Page 2 of 2 <12
Topic Options
#200628 - 2010-11-16 02:43 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: Mart]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
Hi,
i have tasted your code. it doesn´t work. No Printers no network mappings no background :-(

can u help me to debug whats going wrong?




EDIT:
first error when i run: "wkix32.exe login.kix" is:

ERROR: undefined variable [wmiColl]!
Script C:\loginscript\login.kix
Line : 46



This is line 45-47
45 ;Get the current screen resolution using WMI.
46 $wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_DesktopMonitor")
47 For Each $wmiObj in $wmiColl


Edited by backfight (2010-11-16 02:57 PM)

Top
#200707 - 2010-11-23 10:19 AM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
*push*
Top
#200709 - 2010-11-23 10:30 AM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
You need to declare all variables that you have in your script.

Adding Dim $wmiColl will fix this one error but there might be more undeclared variables.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200715 - 2010-11-23 11:52 AM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: Mart]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
Hi,
after i declare all variables i get this error:

ERROR : invalid method/function call: missing comma!
Line: 879


Here is Line 879

 Code:
$rc = WriteLine(1 "Datum der Erfassung     = " + @date + @CRLF)


But what does this error mean?


Edited by backfight (2010-11-23 11:54 AM)

Top
#200717 - 2010-11-23 11:57 AM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
This means exactly what it says. You are missing a comma just after the file handle in the writeline line.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200719 - 2010-11-23 12:41 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: Mart]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
Hi
but i had copied your script code. :-/

now i get this error

ERROR : invalid method/function call: missing ')'!
Line : 906

 Code:
$rc = WriteLine(1, "CPU Modell              = " + @CPU + @CRLF)

but when i use it like this:
 Code:
$rc = WriteLine(1, "CPU Modell              = " + @CPU + @CRLF')'


Nothing change. Same error.

Top
#200721 - 2010-11-23 12:56 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
Why do you have single quotes around the closing parenthesis? Get rid of those and try again.
Top
#200722 - 2010-11-23 01:09 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: BradV]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
 Originally Posted By: BradV
Why do you have single quotes around the closing parenthesis? Get rid of those and try again.


that doesn´t work either

and that is what the error say´s to me. Make single quotes around the closing


Edited by backfight (2010-11-23 01:18 PM)

Top
#200724 - 2010-11-23 01:32 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
The error message had single quotes around the parenthesis to show you what it said is missing. I'm assuming the problem may be before this. Look for missing ending quotes or parenthesis before this line. I think Glenn has a sanity checker on his web site you might want to run this through.
Top
#200869 - 2010-11-29 08:30 AM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: BradV]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
Hi,
that was exactly the mistake. Now the Script is running.

But i have another question.

I wanna make a querry if the OS is Windows XP or Windows 7. When it is Windows 7 the application does not need to run. If it is Win2k or Windows XP the application has to run.

does somebody know how to code this?

thx and bye

Top
#200870 - 2010-11-29 08:58 AM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
You could use the macros that are available in kix. A full list is available starting on page 111 in the 4.61 manual.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200874 - 2010-11-29 01:13 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: Mart]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
where do i get the manual?
Top
#200876 - 2010-11-29 01:20 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
It comes with the download. It is in Word format.
Top
#200884 - 2010-11-29 03:58 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: BradV]
backfight Offline
Getting the hang of it

Registered: 2007-01-22
Posts: 61
Loc: Germany
sorry but i´m not a good programmer and don´t know how to start :-/
can anybody help me?

i have no solution how to get rid of it

Top
#200887 - 2010-11-29 04:14 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
The code below checks if the string returned by @PRODUCTTYPE contains Windows 2000 or Windows XP and does stuff if this is true and does other stuff when it is not true.


 Code:
If InStr(@PRODUCTTYPE, "Windows 2000") Or InStr(@PRODUCTTYPE, "Windows XP")
	;Do stuff
Else
	;Do other stuff
EndIf 
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200901 - 2010-11-29 07:12 PM Re: Does my script runs under Windows 2k8 and 2k8 Active Directory? [Re: backfight]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Click on the Kixtart.org Website link at the top of the page - an online form of the manual is there (command reference) as well as links to get the full documentation in Word or PDF format.

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

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 557 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.072 seconds in which 0.025 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org