#76731 - 2003-09-17 05:58 PM
New Inventory Script
|
tekkmann140
Lurker
Registered: 2003-09-17
Posts: 3
Loc: USA
|
Break On
;-------------------------------------------------------------------------------------------------- ;Program Name: Aida.kix ;Creation Date: 9/17/2003 ;Purpose: Inventory workstations only if Admin logs on. ;Author: Dan Drass ;Company Name: BRTRC ;Instructions: Download a copy of Aida32 Enterprise Edition from http://www.aida32.hu/aida32.php, ; Its free. Register your copy please. ; ; Create a network share called Aida AND put the following files in it: ; Aida32.exe, Aida32.bin , Aida32.dat AND whatever rpf file you create in it as well. ; Give your users RX rights to it. Under your Server\Aida directory, Create another ; directory called Reports. Give your users W access.
; Note: The names of the server directories are unimportant. You can call them ; anything that you want. You can also create CSV files. I like INI files. See the ; Aida32 manual for all the cool command-line options. ; ; You don't need to install Aida on any other machine. ; I've tested this on NT 4.0 Server and W2K machines. You're free to tweak and ; alter this file any way that you like. Cheers to all. ;------------------------------------------------------------------------------------------------ $Selection = MessageBox("Do you want to inventory this machine? Click No to skip this update. Click Yes to inventory now.", "Inventory Updater", 36)
Select
Case $Selection = 2 ? "Cancel selected, continuing...." Goto CANCEL Case $Selection = 6 ? "Yes selected, continuing...." Goto YES Case $Selection = 7 ? "No selected, continuing...." Goto NO
Case 1 ? "Unknown selected, continuing...." Goto Error
EndSelect
:YES Sleep 1 CLS Run "\\server\share\aida\aida32 /R \\server\share\aida\a32reports\$HOSTNAME /INI /Custom \\server\share\aida\test.rpf /Silent /Safe" Goto MESS ;Return
:NO Sleep 1 CLS Goto END
;--------------------------------------Lines added for later use
:Error Sleep 1 CLS $ReturnCode = SendMessage("LANADMIN" , @USERID + " Inventory Error at " + @TIME) If $ReturnCode = 0 ? "Message has been sent to LAN Admin..." Sleep 2 Goto END EndIf
; -----------------------------------------------------------
; ***************************************** ; END OF ROUTINE. END OF PROGRAM ;********************************************
:MESS Sleep 2 CLS ?" Inventory is in progress...please wait....." Sleep 2 CLS Goto END
:END CLS FlushKB Exit
;------------- Just in case everything else fails do this check
CLS
|
|
Top
|
|
|
|
#76732 - 2003-09-17 06:28 PM
Re: New Inventory Script
|
tekkmann140
Lurker
Registered: 2003-09-17
Posts: 3
Loc: USA
|
This all should be on one line. It's word-wrapped. Run "\\server\share\aida\aida32 /R \\server\share\aida\a32reports\$HOSTNAME /INI /Custom \\server\share\aida\test.rpf /Silent /Safe"
|
|
Top
|
|
|
|
#76733 - 2003-09-17 06:32 PM
Re: New Inventory Script
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
use code tages and you fix the problem
|
|
Top
|
|
|
|
#76734 - 2003-09-17 06:38 PM
Re: New Inventory Script
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
btw.... prepare for a canadian 'busting' as soon as he sees gotos in your script.
|
|
Top
|
|
|
|
#76735 - 2003-09-18 04:29 PM
Re: New Inventory Script
|
tekkmann140
Lurker
Registered: 2003-09-17
Posts: 3
Loc: USA
|
I like to follow the K.I.S.S. principal when running my network. Personally, I hate programming. Here I just do not have the time or inclination to "program" anything. Third party solutions, short batch files and kix scripts are the way to go for me. Canadian busting? What the hell is that? And who cares? LOL
|
|
Top
|
|
|
|
#76736 - 2003-09-18 08:08 PM
Re: New Inventory Script
|
Vertigo1
Lurker
Registered: 2003-09-18
Posts: 1
|
With COol code tags.
code:
Break On
;-------------------------------------------------------------------------------------------------- ;Program Name: Aida.kix ;Creation Date: 9/17/2003 ;Purpose: Inventory workstations only if Admin logs on. ;Author: Dan Drass ;Company Name: BRTRC ;Instructions: Download a copy of Aida32 Enterprise Edition from http://www.aida32.hu/aida32.php, ; Its free. Register your copy please. ; ; Create a network share called Aida AND put the following files in it: ; Aida32.exe, Aida32.bin , Aida32.dat AND whatever rpf file you create in it as well. ; Give your users RX rights to it. Under your Server\Aida directory, Create another ; directory called Reports. Give your users W access.
; Note: The names of the server directories are unimportant. You can call them ; anything that you want. You can also create CSV files. I like INI files. See the ; Aida32 manual for all the cool command-line options. ; ; You don't need to install Aida on any other machine. ; I've tested this on NT 4.0 Server and W2K machines. You're free to tweak and ; alter this file any way that you like. Cheers to all. ;------------------------------------------------------------------------------------------------
$Selection = MessageBox("Do you want to inventory this machine? Click No to skip this update. Click Yes to inventory now.", "Inventory Updater", 36)
Select
Case $Selection = 2 ? "Cancel selected, continuing...." Goto CANCEL Case $Selection = 6 ? "Yes selected, continuing...." Goto YES Case $Selection = 7 ? "No selected, continuing...." Goto NO
Case 1 ? "Unknown selected, continuing...." Goto Error
EndSelect
:YES Sleep 1 CLS Run "\\server\share\aida\aida32 /R \\server\share\aida\a32reports\$HOSTNAME /INI /Custom \\server\share\aida\test.rpf /Silent /Safe" Goto MESS ;Return
:NO Sleep 1 CLS Goto END
;--------------------------------------Lines added for later use
:Error Sleep 1 CLS $ReturnCode = SendMessage("LANADMIN" , @USERID + " Inventory Error at " + @TIME) If $ReturnCode = 0 ? "Message has been sent to LAN Admin..." Sleep 2 Goto END EndIf
; -----------------------------------------------------------
; ***************************************** ; END OF ROUTINE. END OF PROGRAM ;********************************************
:MESS Sleep 2 CLS ?" Inventory is in progress...please wait....." Sleep 2 CLS Goto END
:END CLS FlushKB Exit
;------------- Just in case everything else fails do this check
CLS
|
|
Top
|
|
|
|
#76738 - 2003-09-19 01:47 AM
Re: New Inventory Script
|
JohnQ
Starting to like KiXtart
Registered: 2003-03-04
Posts: 171
|
I'm not sure if Jens is Canadian or even the person that Radimus was refering to but now you know what a 'GOTO BUSTING' is.
Don't feel bad... I think he's busted everyone at some point. His points are valid though. Just do a couple of searches on the board and you'll find plenty of reasons why you shouldn't use GOTO and better methods of accomplishing things.
You're better off saving the GOTO's for your batch files.
|
|
Top
|
|
|
|
#76740 - 2003-09-19 02:02 AM
Re: New Inventory Script
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Jens is already German... it would be too much if you made hime part French too
|
|
Top
|
|
|
|
#76743 - 2003-09-19 09:54 AM
Re: New Inventory Script
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
see your code for BEFORE:
The is AFTER: code:
$Selection = MessageBox("Do you want to inventory this machine? Click No to skip this update. Click Yes to inventory now.", "Inventory Updater", 36) Select Case $Selection = 2 ? "Cancel selected, continuing...." Case $Selection = 6 ? "Yes selected, continuing...." Run "\\server\share\aida\aida32 /R \\server\share\aida\a32reports\$HOSTNAME /INI /Custom \\server\share\aida\test.rpf /Silent /Safe" ?" Inventory is in progress...please wait....." Case $Selection = 7 ? "No selected, continuing...." Case 1 ? "Unknown selected, continuing...." $ReturnCode = SendMessage("LANADMIN" , @USERID + " Inventory Error at " + @TIME) If $ReturnCode = 0 ? "Message has been sent to LAN Admin..." EndIf EndSelect CLS FlushKB Exit
Note that you have an unassigned GOTO quote: Case $Selection = 7 ? "No selected, continuing...." Goto NO
and a bunch of sleep statements... probably for the entertainment of your users (users can't read) and CLS statements (so they only had 1 line to read at a time.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 895 anonymous users online.
|
|
|