betatester Posted December 1, 2008 Share Posted December 1, 2008 i'm using this script as an ie replacement(binary is iexplore.exe) to stop some pesky programs from using ie instead of my default browser:; Script Function:blah blah goodbye ie#NoTrayIconif $CmdLine[0] > 0 ThenShellExecute("G:\applications-x\KMplus\k-meleon.exe", $CmdLineRaw);ElseShellExecute("G:\applications-x\KMplus\k-meleon.exe")EndIfit all works fine but some programs initiate a url command with '-nohone'. which my browser doesn't understand and initiates a websearch with the term instead of going to the right url.i need to know how to remove =nohome from the command if it exists.. i tried this but ofcourse it's messed up:; Script Function:blah blah goodbye ie#NoTrayIconif $CmdLine[1]="-nohome" ThenShellExecute("G:\applications-x\KMplus\k-meleon.exe", $CmdLine[2]);Elseif $CmdLine[0] > 0 ThenShellExecute("G:\applications-x\KMplus\k-meleon.exe", $CmdLineRaw);ElseShellExecute("G:\applications-x\KMplus\k-meleon.exe")EndIfthank you Link to comment Share on other sites More sharing options...
zorphnog Posted December 1, 2008 Share Posted December 1, 2008 (edited) #NoTrayIcon $sStrippedCmd = StringRegExpReplace($CmdLineRaw, "(?i)-nohome/s", "") if $CmdLine[0] > 0 Then ShellExecute("G:\applications-x\KMplus\k-meleon.exe", $sStrippedCmd); Else ShellExecute("G:\applications-x\KMplus\k-meleon.exe") EndIf Edited December 1, 2008 by zorphnog Link to comment Share on other sites More sharing options...
betatester Posted December 1, 2008 Author Share Posted December 1, 2008 #NoTrayIcon $sStrippedCmd = StringRegExpReplace($CmdLineRaw, "(?i)-nohome/s", "") if $CmdLine[0] > 0 Then ShellExecute("G:\applications-x\KMplus\k-meleon.exe", $sStrippedCmd); Else ShellExecute("G:\applications-x\KMplus\k-meleon.exe") EndIf thanks zenph.. it didn't actually work but i got the idea.. thank you so much! this works: #NoTrayIcon $sStrippedCmd = StringRegExpReplace($CmdLineRaw, "-nohome ", "") if $CmdLine[0] > 0 Then ShellExecute("G:\applications-x\KMplus\k-meleon.exe", $sStrippedCmd); Else ShellExecute("G:\applications-x\KMplus\k-meleon.exe") EndIf thanks again, really appreciate it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now