Page 2 of 2 <12
Topic Options
#147653 - 2005-09-13 05:53 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
I thank you very much for the assistance and the in side scoop on how to post code. I will be sure to comply going forward.

Again, I really appreciate your assistance.

Top
#147654 - 2005-09-13 06:49 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
I seem to be getting a "failed to find/open script" upon login.
The script is located in the Netlogon share along with the Kix32.exe.

Top
#147655 - 2005-09-13 08:59 PM Re: Disable Beep??
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes.
you need to call the script with explicit path if you call it from batch file.

see my post above about it (you need to use the %0\..\ trick)
_________________________
!

download KiXnet

Top
#147656 - 2005-09-13 09:11 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
I am unable to get the to work. I fixed the permissions issue and the script will run but no printers are created. It just flies right on by.
Have I done something wrong with the script?


Code:
if ingroup("18EastPrint")
If ADDPRINTERCONNECTION ("\\print01\18_East") = 0
? "Added printer connection...."
endif
If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."
endif
If SetDefaultPrinter ("\\print01\18_East") = 0
? "Set default printer to 18_East...."
endif
endif

if ingroup ("18NortheastPrint")
If ADDPRINTERCONNECTION ("\\print01\18_Northeast") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\18_Northeast") = 0
? "Set default printer to 18_Northeast...."

Endif

Endif

if ingroup ("18SoutheastPrint")
If ADDPRINTERCONNECTION ("\\print01\18_Southeast") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\18_Southeast") = 0
? "Set default printer to 18_Southeast...."

Endif

Endif

if ingroup ("18SouthwestPrint")
If ADDPRINTERCONNECTION ("\\print01\18_Southwest") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\18_Southwest") = 0
? "Set default printer to 18_Southwest...."

Endif

Endif


if ingroup ("18WestPrint")
If ADDPRINTERCONNECTION ("\\print01\18_West") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\18_West") = 0
? "Set default printer to 18_West...."

Endif

Endif

if ingroup ("Immigration4100Print")
If ADDPRINTERCONNECTION ("\\print01\Immigration4100") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\Immigration4100") = 0
? "Set default printer to Immigration4200...."

Endif

Endif

if ingroup ("Immigration4200Print")
If ADDPRINTERCONNECTION ("\\print01\Immigration4200") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\Immigration4200") = 0
? "Set default printer to Immigration4200...."

Endif

Endif

if ingroup ("RecordsPrint")
If ADDPRINTERCONNECTION ("\\print01\Records4000") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\Records4000") = 0
? "Set default printer to 18_Records4000...."

Endif

Endif

if ingroup ("SASPrint")
If ADDPRINTERCONNECTION ("\\print01\SAS4100") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\SAS4100") = 0
? "Set default printer to SAS4100...."

Endif

Endif

if ingroup ("GSPrint")
If ADDPRINTERCONNECTION ("\\print01\GSCopier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\GSCopier") = 0
? "Set default printer to GSCopier...."

Endif

Endif

if ingroup ("HRPrint")
If ADDPRINTERCONNECTION ("\\print01\HumanResources") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\HumanResources") = 0
? "Set default printer to HumanResources...."

Endif

Endif

if ingroup ("TrustPrint")
If ADDPRINTERCONNECTION ("\\print01\18West_Trust") = 0
? "Added printer connection...."

If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."

If SetDefaultPrinter ("\\print01\18West_Trust") = 0
? "Set default printer to 18West_Trust...."

Endif

Endif



Edited by bippyfeb2098 (2005-09-13 09:14 PM)

Top
#147657 - 2005-09-13 10:05 PM Re: Disable Beep??
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes you have.
every if needs corresponding endif.

you have endifs only for if ingroup lines.
_________________________
!

download KiXnet

Top
#147658 - 2005-09-13 10:09 PM Re: Disable Beep??
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Nice that you use code tags, but it would be nicer if you actually indented your code.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#147659 - 2005-09-13 10:55 PM Re: Disable Beep??
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Here is what it looks like with the proper amount of EndIf's and indented code...

Code:

if ingroup("18EastPrint")
If ADDPRINTERCONNECTION ("\\print01\18_East") = 0
? "Added printer connection...."
endif
If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."
endif
If SetDefaultPrinter ("\\print01\18_East") = 0
? "Set default printer to 18_East...."
endif
endif

if ingroup ("18NortheastPrint")
If ADDPRINTERCONNECTION ("\\print01\18_Northeast") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\18_Northeast") = 0
? "Set default printer to 18_Northeast...."
Endif
Endif

if ingroup ("18SoutheastPrint")
If ADDPRINTERCONNECTION ("\\print01\18_Southeast") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\18_Southeast") = 0
? "Set default printer to 18_Southeast...."
Endif
Endif

if ingroup ("18SouthwestPrint")
If ADDPRINTERCONNECTION ("\\print01\18_Southwest") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\18_Southwest") = 0
? "Set default printer to 18_Southwest...."
Endif
Endif

if ingroup ("18WestPrint")
If ADDPRINTERCONNECTION ("\\print01\18_West") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\18_West") = 0
? "Set default printer to 18_West...."
Endif
Endif

if ingroup ("Immigration4100Print")
If ADDPRINTERCONNECTION ("\\print01\Immigration4100") = 0
? "Added printer connection...."
EndIF
If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\Immigration4100") = 0
? "Set default printer to Immigration4200...."
Endif
Endif

if ingroup ("Immigration4200Print")
If ADDPRINTERCONNECTION ("\\print01\Immigration4200") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\Immigration4200") = 0
? "Set default printer to Immigration4200...."
Endif
Endif

if ingroup ("RecordsPrint")
If ADDPRINTERCONNECTION ("\\print01\Records4000") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\Records4000") = 0
? "Set default printer to 18_Records4000...."
Endif
Endif

if ingroup ("SASPrint")
If ADDPRINTERCONNECTION ("\\print01\SAS4100") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18E_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\SAS4100") = 0
? "Set default printer to SAS4100...."
Endif
Endif

if ingroup ("GSPrint")
If ADDPRINTERCONNECTION ("\\print01\GSCopier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\GSCopier") = 0
? "Set default printer to GSCopier...."
Endif
Endif

if ingroup ("HRPrint")
If ADDPRINTERCONNECTION ("\\print01\HumanResources") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\HumanResources") = 0
? "Set default printer to HumanResources...."
Endif
Endif

if ingroup ("TrustPrint")
If ADDPRINTERCONNECTION ("\\print01\18West_Trust") = 0
? "Added printer connection...."
EndIf
If ADDPRINTERCONNECTION ("\\print01\18W_Copier") = 0
? "Added printer connection...."
EndIf
If SetDefaultPrinter ("\\print01\18West_Trust") = 0
? "Set default printer to 18West_Trust...."
Endif
Endif


Top
#147660 - 2005-09-14 07:09 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Thank so much. All of you. It worked great. The only issue I am having now is that I would like to remove the "old" connections to the soon to be defunct printserver.
Is there a way using the Code:
delprinterconnection 

command that will delete all connections to printserver rather than printer?

Thank you again.


Edited by bippyfeb2098 (2005-09-14 07:19 PM)

Top
#147661 - 2005-09-14 07:16 PM Re: Disable Beep??
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you can simply do:
delprinterconnection('')

before you start mapping new ones.
if that does not work, you can always get the delPrinterConnectionS() udf from udf library.
and if you only want to del the connections to one server, well, just modify the code of that udf.
_________________________
!

download KiXnet

Top
#147662 - 2005-09-14 07:19 PM Re: Disable Beep??
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
why I say if that does not work.
well, it's known to not work more than work.
_________________________
!

download KiXnet

Top
#147663 - 2005-09-14 07:21 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
you da man, Jooel.
Top
#147664 - 2005-09-14 07:28 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Seems to work sometimes and not others.
Top
#147665 - 2005-09-14 10:14 PM Re: Disable Beep??
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Stop the beep (though late and you seem to be fixing the code now)

Code:
Break On
Dim $NB
$NB=WriteValue('HKCU\Control Panel\Sound','Beep','No',REG_SZ)


 

Top
#147666 - 2006-02-14 11:13 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Quote:

you can simply do:
delprinterconnection('')

before you start mapping new ones.
if that does not work, you can always get the delPrinterConnectionS() udf from udf library.
and if you only want to del the connections to one server, well, just modify the code of that udf.




You mention that I could delete all printer connections that are hosted on a certain server...how would I do so?

Top
#147667 - 2006-02-17 06:25 PM Re: Disable Beep??
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
The function is displayed on this page (DelPrinterConnections)
Top
#147668 - 2006-02-21 05:34 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Thank you, I have been redirected to this link a few times, yet I still do not know how to incorporate it into deleting print connections from one particular server.
Top
#147669 - 2006-02-21 08:23 PM Re: Disable Beep??
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Don't incorporate the UDF, borrow from it for inspiration.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#147670 - 2006-02-21 08:59 PM Re: Disable Beep??
bippyfeb2098 Offline
Fresh Scripter

Registered: 2005-09-12
Posts: 39
Thanks for the philosophical enlightenment, Les
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 128 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.073 seconds in which 0.027 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