Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WshShell.Run insists on opening an IE window

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62126
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WshShell.Run insists on opening an IE window
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 WshShell.Run insists on opening an IE window - 7/2/2008 7:33:18 AM   
  scottatah

 

Posts: 1
Score: 0
Joined: 7/2/2008
Status: offline
EDIT:  Alright, I can't explain why, but it turns out all the coding was fine.  If i run this through Outlook Express, I get an IE window as well as the program launching.  If I use Outlook, it works perfect.  I only used OE cause it was installed on the development machine - arg.  Luckily Outlook is the corporate standard.
 
Issue Resolved




Hey Folks,

I'm not much of a coder, but I was given a task and am trying to complete it.  Essentially i'm trying to place a link inside an email that will open a ticketing program (incident management software) and go to a specific ticket.  AKA, an end user calls the help desk and submits a trouble ticket.  The help desk sends that ticket off to some amazing IT department and the program in turn sends them an email saying ticket # XXXXXX has been assigned to you, please complete it.  I'd like for them to be able to click on the link, have it launch the software if not already open and navigate to that particular ticket number. 

I've got everything working and built into a lil batch file, but for some reason, when you click on a link, an IE window opens first trying to navigate to "HEAT:XXXXXX", where xxxxxx is the ticket number.  Then a split second later, the HEAT software opens to the specific ticket number.  I can't figure out why this IE window opens, but it's definitely not needed and a bit of a nuissance.  This happens in both IE6 and IE7 on Windows XP Pro.

CallLog32.exe is the name of the application
HEAT is the name of the software in general
/c is the command line parameter to open a specific ticket

I'm kinda thinking this WshShell.Run is my issue cause it's what i'm most unfamiliar with granted, it seems pretty straight forward according to the internet.  Below is what has been written up.  Keep in mind I'm no expert on this stuff, but any ideas or suggestions are appreciated as this is driving me crazy.



@ECHO OFF
Set HeatDir=%programfiles%\HEAT
:SetPathLoop
if exist "%heatdir%\calllog32.exe" goto SetPathDone
echo CallLog32.exe not found in %heatdir%&echo.&set /p HeatDir=Please specify path (no slash at the end):
echo.
goto SetPathLoop
:SetPathDone



echo Building Registry File...
> "%temp%\heaturl.reg" echo Windows Registry Editor Version 5.00
>>"%temp%\heaturl.reg" echo.
>>"%temp%\heaturl.reg" echo [HKEY_CLASSES_ROOT\HEAT]
>>"%temp%\heaturl.reg" echo "URL Protocol"=""
>>"%temp%\heaturl.reg" echo @="URL:HEAT Protocol"
>>"%temp%\heaturl.reg" echo.
>>"%temp%\heaturl.reg" echo [HKEY_CLASSES_ROOT\HEAT\shell]
>>"%temp%\heaturl.reg" echo.
>>"%temp%\heaturl.reg" echo [HKEY_CLASSES_ROOT\HEAT\shell\open]
>>"%temp%\heaturl.reg" echo.
>>"%temp%\heaturl.reg" echo [HKEY_CLASSES_ROOT\HEAT\shell\open\command]
>>"%temp%\heaturl.reg" echo @="wscript.exe \"%HeatDir:\=\\%\\HeatURLProtocolLauncher.vbs\" %%1"
echo.
echo Merging Registry File...
regedt32 /s "%temp%\heaturl.reg"
echo.
echo Building HeatURLProtocolLauncher.vbs...
>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strHEAT = "%HeatDir%\CallLog32.exe"
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo.
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo Select Case WScript.Arguments.Count
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo Case 0
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = " "
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo Case Else
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo Set colArgs = WScript.Arguments
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo For i = 0 To WScript.Arguments.Count - 1
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = " " ^& WScript.Arguments.Item(i)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo Next
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo End Select
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo.
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo Set WshShell = CreateObject("WScript.Shell")
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = StripURLProtocol(strCallNo)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo WshShell.Run """" ^& strHEAT ^& """ /c " ^& strCallNo ^& ""
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo WScript.Quit
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo.
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo Function StripURLProtocol(strCallNo)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = Trim(strCallNo)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo 'Remove protocol if it was passed
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo If InStr(strCallNo, "HEAT:") = 1 Then
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = Right(strCallNo, Len(strCallNo) - 5)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo End If
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo If InStr(strCallNo, "Heat:") = 1 Then
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = Right(strCallNo, Len(strCallNo) - 5)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo End If
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo If InStr(strCallNo, "heat:") = 1 Then
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = Right(strCallNo, Len(strCallNo) - 5)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo End If
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo 'Remove slashes if present
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo If InStr(strCallNo, "/") = 1 Then
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo strCallNo = Left(strCallNo, Len(strCallNo) - 1)
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo End If
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo 'Return cleaned call number
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo StripURLProtocol = strCallNo
>>"%HeatDir%\HeatURLProtocolLauncher.vbs" echo End Function
echo.
echo Cleaning Up Temp Files...
del %temp%\heaturl.reg
echo.
echo.
echo.
echo.
echo.
echo.
echo The HEAT URL protocol has been installed.
echo.
echo You can now access ^<a href="HEAT:[call number]"^>
echo links on websites.
echo.
echo Press any key to exit.
pause >nul



< Message edited by scottatah -- 7/2/2008 10:15:10 AM >
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WshShell.Run insists on opening an IE window Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts