#173331 - 2007-01-28 04:46 PM
ANY SAVIOUR I N HERE TODAY??
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
OK so finally i got a script written. what i will be doing is put it into a GPO and then when th user logon it automathically runs itself with no user prompt; essentially i want it to be in passive mode, and i need it to reboot after the script too..... When i debug this scrip it gives me an 'Invalid function call error" Please help me......
Break off
If Exist ("C:\Program Files\Pivotal\Relation") = 0
MessageBox ("Please wait while Relationship is uninstalled") Shell 'C:\WINDOWS\uninst.exe-y -f"C:\Program Files\Pivotal\Relation" >NUL 2>NUL /passive' Sleep 6 Else
? "Error Code = " @Error " Error Details = " @Serror
EndIf
|
Top
|
|
|
|
#173332 - 2007-01-28 05:12 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: selormquarshie]
|
Gargoyle
MM club member
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
|
$rc = messagebox("Please wait while Relationship is uninstalled","Uninstall",0,48,6)
From the manual
MESSAGEBOX Action
Displays a standard dialog box in Windows.
Syntax
MESSAGEBOX ("message", "title", style, time-out)
Parameters
Message
The message to display in the dialog box.
Title
The title of the dialog box.
Style
Optional numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality. The following table illustrates the values used and the meaning of each group of values.
Buttons to display
Value Meaning 0 Display OK button only. 1 Display OK and Cancel buttons. 2 Display Abort, Retry, and Ignore buttons. 3 Display Yes, No, and Cancel buttons. 4 Display Yes and No buttons. 5 Display Retry and Cancel buttons.
Icon to display
Value Meaning 16 Stop symbol 32 Question mark 48 Exclamation mark 64 Information symbol
Default button
Value Meaning 0 First button is default. 256 Second button is default. 512 Third button is default.
Modality
Value Meaning 0 Application-modal. The user must respond to the message box before continuing work in the application. 4096 System-modal. All applications are suspended until the user responds to the message box.
When adding numbers to create a final value for the argument type, use only one number from each group. If style is omitted, a default value of 0 is assumed.
Time-out
Optional numeric expression representing the number of seconds after which to close the dialog box.
Note
The time-out feature only works if the MESSAGEBOX dialog box is the active window for the duration of the time-out. If the user switches away from KiXtart and activates another application, the MESSAGEBOX dialog box is not closed.
Remarks
MESSAGEBOX displays a maximum of 1024 characters in application-modal dialog boxes. Longer messages are truncated after the 1024th character. Message strings longer than 255 characters with no intervening spaces are truncated after the 255th character. For system-modal dialog boxes, the number of characters you can display depends on screen resolution and number of lines in the message.
MESSAGEBOX breaks lines automatically at the right edge of the dialog box. If you want to set line breaks yourself, place a linefeed (ANSI character 10) before the first character of the text that is to begin each new line.
Returns
The value returned by MESSAGEBOX indicates which button was selected, as shown in the following table.
Value Meaning -1 User did not respond to the dialog box within the specified time-out period. 1 OK button selected. 2 Cancel button selected. 3 Abort button selected. 4 Retry button selected. 5 Ignore button selected. 6 Yes button selected. 7 No button selected.
If the dialog box contains a Cancel button, pressing esc has the same effect as choosing Cancel.
_________________________
Today is the tomorrow you worried about yesterday.
|
Top
|
|
|
|
#173334 - 2007-01-28 06:01 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: Les]
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
I did the recommended changes but it still returns the same error...please help, anyone........
Break off
If Exist ("C:\Program Files\Pivotal\Relation") = 0
$rc = MessageBox("Please wait while Relationship is uninstalled","ESI INTL",0) Shell 'C:\WINDOWS\uninst.exe -y -f "C:\Program Files\Pivotal\Relation" /passive' Sleep 6 Else
? "Error Code = " @Error " Error Details = " @Serror
EndIf
|
Top
|
|
|
|
#173336 - 2007-01-28 06:58 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: Les]
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
so how would you reqrite the Exist logic?
|
Top
|
|
|
|
#173341 - 2007-01-28 09:15 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: Sealeopard]
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
ok here's what i got now...however when i debug ..it jumps the MESSAGEBOX () and it does not show the SHELL command. Yes all my users have local admin rights...using kix 4.51. please any suggestions are welcome...my deadline is noon tomorrow....please help...
Break off
If Exist ("C:\Program Files\Pivotal\Relation") = 1
$rc = MessageBox("Please wait while Relationship is uninstalled","ESI INT'L", 10, 0, 1)
Shell 'C:\WINDOWS\uninst.exe -y -f "C:\Program Files\Pivotal\Relation" /passive'
Sleep 6
Else
? "Error Code = " @Error " Error Details = " @Serror
EndIf
$rc = Shutdown("", "System is being rebooted to enable new settings.", 30, 0, 1)
[edit: code tags added by Allen.]
Edited by Allen (2007-01-28 09:24 PM)
|
Top
|
|
|
|
#173342 - 2007-01-28 09:30 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: selormquarshie]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
As you have it now, it looks like the shutdown will be a continuous loop... everyone will be effected by it to... also please place your code in between the code tags (# on the post bar).
Might you give this a try (untested)
$programpath="C:\Program Files\Pivotal\Relation\"
If Exist($programpath)
$rc = MessageBox("Please wait while Relationship is uninstalled","ESI INT'L", 10, 0, 1)
Shell 'C:\WINDOWS\uninst.exe -y -f "C:\Program Files\Pivotal\Relation" /passive'
Sleep 6
$rc = Shutdown("", "System is being rebooted to enable new settings.", 30, 0, 1)
Else
? $programpath + " Does not Exist"
EndIf
|
Top
|
|
|
|
#173344 - 2007-01-28 09:43 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: Allen]
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
Moderator, your sample code jumps from the Exist command straight to the ? $programpath + " Does not Exist" line when i attempt to debug it...i guess it should go thru all required steps in debug mode but it's not happening here....i appreciate all your help so please keep them coming....
$programpath="C:\Program Files\Pivotal\Relation\" If Exist($programpath) $rc = MessageBox("Please wait while Relationship is uninstalled","ESI INT'L", 10, 0, 1) Shell 'C:\WINDOWS\uninst.exe -y -f"C:\Program Files\Pivotal\Relation" /passive' Sleep 6 $rc = Shutdown("", "System is being rebooted to enable new settings.", 30, 0, 1) Else ? $programpath + " Does not Exist" EndIf
|
Top
|
|
|
|
#173346 - 2007-01-28 10:52 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: Lonkero]
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
i'm testing at home b4 i deploy on the network tomorrow at work, so i did a sample on my machine but it's still not taking....
$programpath="C:\Program Files\Macromedia\Dreamweaver MX\" If Exist($programpath) Shell 'C:\WINDOWS\uninst.exe -y -f "C:\Program Files\Macromedia\Dreamweaver MX" ' Sleep 6 $rc = Shutdown("", "System is being rebooted to enable new settings.", 30, 0, 1)
Else ? $programpath + " Does not Exist" EndIf
|
Top
|
|
|
|
#173348 - 2007-01-28 11:37 PM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: Les]
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
YOu are right..however i gave the code a different input, it should look for maromedia\DreamweaverMX\and delete it o nmy local compuater at home but it wont run that.....am i doing anything wrong. i have Dreamweaver on my pc here.....
$programpath="C:\Program Files\Macromedia\Dreamweaver MX\" If Exist($programpath) Shell 'C:\WINDOWS\uninst.exe -y -f "C:\Program Files\Macromedia\Dreamweaver MX" ' Sleep 6 $rc = Shutdown("", "System is being rebooted to enable new settings.", 30, 0, 1)
Else ? $programpath + " Does not Exist" EndIf
|
Top
|
|
|
|
#173350 - 2007-01-29 02:54 AM
Re: ANY SAVIOUR I N HERE TODAY??
[Re: Les]
|
selormquarshie
Getting the hang of it
Registered: 2006-12-24
Posts: 85
|
Should it matter if i am just debugging the code....i thought it will go thru the whole process in debug mode??
Break Off $programpath="C:\Program Files\Pivotal\Relation\"
If Exist($programpath)
$rc = MessageBox("Please wait while Relationship is uninstalled","ESI INT'L", 10, 0, 1)
Shell 'C:\WINDOWS\uninst.exe -y -f"C:\Program Files\Pivotal\Relation\DeIsL1.isu" /passive' Sleep 6
$rc = Shutdown("", "System is being rebooted to enable new settings.", 30, 0, 1)
Else ? $programpath + "Does not Exist" EndIf
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|