#124892 - 2004-08-18 03:37 PM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
Well I just clicked on the link Les left on his post !
|
Top
|
|
|
|
#124894 - 2004-08-19 01:26 PM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
Exactly !! But well I realized that I'm really bad with Kix because can't make this ComputerInGroup UDF stuff works...
|
Top
|
|
|
|
#124896 - 2004-08-19 04:41 PM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
Well I've got an error but I don't have the time to read the window disappear before I can read... How can i check the error ? I told you I'm noob...
|
Top
|
|
|
|
#124898 - 2004-08-19 04:52 PM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
Version of WKIX32.exe is 4.11.00. Here's the srcipt I tried to test the ComputerInGroup Function (I put the sllep 10 in order to have the time to read errors but it doesn't work) :
Function ComputerInGroup ($group,$domain) Dim $oGrp if not $domain $domain=@domain endif $oGrp = GetObject("WinNT://" + $domain + "/" + $Group + ",group" ) if @error exit 1 endif if $oGrp.IsMember("WinNT://" + $doamin + "/" + @wksta + "$$" ) $ComputerInGroup=1 else $ComputerInGroup=0 endif endfunction
If ComputerInGroup ("PC-CENT-SI")=1 ? 'UDF ComputerInGroup works...' Endif
sleep 10
Am I wrong ? I guess I am...
|
Top
|
|
|
|
#124900 - 2004-08-19 05:24 PM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
Well even if I launch the script from the dos box, it exit by itself and still can't read the error message... Grrrrrrrrr !
|
Top
|
|
|
|
#124902 - 2004-08-20 09:17 AM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
Ok I got the error message... Here it is :
Script error: invalid method/function call: missing required parameter 2! If ComputerInGroup ("PC-CENT-SI")=1
I'm going to check in the forum if I find something on this !
|
Top
|
|
|
|
#124904 - 2004-08-20 10:14 AM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
YES !!!! Really thank to everybody you helped me found what was wrong !!! First of all I wrote "doamin" in my script instead of "domain" ! Then this part of the script : If ComputerInGroup ("PC-CENT-SI")=1 ? 'UDF ComputerInGroup works...'else ? 'UDF ComputerNOT InGroup...'Endif 'Error #'+@Error+' ['+@SError+']' helped me a lot to found what was wrong ! Now it works well I'm going to add my printers I'll confirm you that all work fine !! Again thanks to all !!
|
Top
|
|
|
|
#124906 - 2004-08-20 02:01 PM
Re: Still can't add network printer...
|
HelpMe
Fresh Scripter
Registered: 2004-08-11
Posts: 16
|
Well I'll try to explain what I understood...  Here's the function I finally have : Function ComputerInGroup ($group) Dim $oGrp $oGrp = GetObject("WinNT://" + @domain + "/" + $Group + ",group" ) if @error exit 1 endif if $oGrp.IsMember("WinNT://" + @domain + "/" + @wksta + "$$" ) $ComputerInGroup=1 else $ComputerInGroup=0 endif endfunction
In fact I was wrong with the $domain stuff, I made a syntax error I guess (don't really know) but I realized I didn't need the $domain, since we only have one domain... So I wrote it again using the example you gave me (that's how I saw I wrote doamin instead of domain the first time). Then the function call worked !!!! I'm not sure but does this answer your question ?
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 2145 anonymous users online.
|
|
|