cldpeak
Posts: 270
Score: 6 Joined: 7/11/2002 Status: offline
|
Okay, Now I see that the example you posted is from Ron Crumbaker's web remote tools... - but it did get me on the right track! In my case, to add this button to the Computer Details report in SMS 2003 Reporting, you will need to: Edit Inetpub\WWWRoot\SMSReporting_XXX\ReportsNav.asp Search for the string "</BUTTON>" (without quotes) This should put you near the end of <DIV class=ComputerNameBox>, right after where the value button is defined. Make some slight modifications to the example button line to match the style of the values button: <input style="margin-left: 8px" class=ValuesButton type="button" value="Remote" name="Btnl10" ID="Button8"> Insert this line between </BUTTON> and </DIV> It should look like this snippet taken from my ReportsNave.asp:
<DIV id=divComputerNameBlock style="display:<%
If sMachineDetails = "True" Then
Response.Write "block"
Else
Response.Write "none"
End If%>">
<DIV class=ComputerNameBox>
<DIV style="margin-bottom: 5px">
<LABEL class=SimpleTextSmall id=lblComputerPrompt for=MachineName>
<%=Server.HTMLEncode(fMsg.FormatModuleString(sDll, IDS_RWPT_COMP_NAME))%><br>
<%=Server.HTMLEncode(fMsg.FormatModuleString(sDll, IDS_RWPT_REDUCE_VALUES))%>
</LABEL>
</DIV>
<INPUT id=MachineName name=MachineName type=text class=InputBox tabindex=0 value="<%
If sMachineDetails = "True" Then
Response.Write Server.HTMLEncode(sMachine)
End If%>" LANGUAGE=javascript onkeypress="return MachineName_onkeypress()">
<BUTTON id=btnBrowse style="margin-left: 8px" class=ValuesButton tabindex=0 LANGUAGE=javascript onclick="return btnBrowse_onclick()" disabled>
<%=Server.HTMLEncode(fMsg.FormatModuleString(sDll, IDS_RWPT_STND_RPT_FLTR))%>
</BUTTON>
<input style="margin-left: 8px" class=ValuesButton type="button" value="Remote" name="Btnl10" ID="Button8">
</DIV>
</DIV>
Next, we must take the sample code and modify it a bit to read the value that was in the Computer Details text box. It can also be placed near the very end of ReportsNav.asp right after </BODY> but before </Script> and </HTML>. Finally, I added script language parameter, the end of ReportsNave.asp should end up looking like this:
<%End If%>
<INPUT type=hidden id=txtReportID name=txtReportID value="0" tabindex=-1>
<INPUT type=hidden id=txtVariableName name=txtVariableName value="" tabindex=-1>
<INPUT type=hidden id=txtPrompt name=txtPrompt value="" tabindex=-1>
</BODY>
<Script Language=vbscript>
Sub Btnl10_OnClick
dim CompName
Dim wshshell
set wshshell = createobject("wscript.shell")
CompName = document.all("MachineName").value
If len(Trim(CompName)) = 0 then
MsgBox "Please type a Machine Name.",,"System Resources"
WScript.Quit
End If
WshShell.Run "%windir%\pchealth\helpctr\binaries\helpctr.exe -FromStartHelp " & _
"-url hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/unsolicited/SMSUnsolicitedRCUI.htm " & _
"-ExtraArgument " & "NOVICECOMPUTER=" & CompName & """"
End Sub
</Script>
</HTML>
On the client side internet explorer 6 browser, At first, the button seemed to take no action when clicked. However, in the lower left of IE a yellow script error icon, double click and show details, reveals an error "ActiveX component can't create object: 'wscript.shell' This can also be solved by the IE browser menu bar: Tools | Internet Options | Security Tab | Local internet Review "ActiveX controls and plug ins" some may be disabled, such as "Download unsigned ActiveX controls", "initialize and script..." etc... Enable these or add to trusted sites.
|