#190358 - 2008-10-28 11:47 PM
Do I need a .bat file to call a URL?
|
Bonfils
Just in Town
Registered: 2008-10-28
Posts: 4
|
Pardon the ignorance but VERY new to KiXtart.
I am trying to load internet explorer with a specific URL during startup, would anyone be able to tell me how I would go about doing this? Am I right in thinking I should run a bat file with URL or is there a native command in Kix I can use?
Many thanks
Edited by Bonfils (2008-10-29 12:34 AM)
|
|
Top
|
|
|
|
#190359 - 2008-10-29 01:12 AM
Re: Do I need a .bat file to call a URL?
[Re: Bonfils]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
Welcome!
Now - everyone join in and say: "No!" 
You can use the Shell command to invoke external commands that Kix will wait for, or Run to invoke a command that runs independent of your script.
One of the best ways to accomplish this (and the easiest to debug) is to create a variable that holds the command, then display it, and finally run it. When it is working fine, you can remove the "display it" step. Something like:
$Cmd = 'iexplore.exe' ; base command
$Cmd = $Cmd + ' http://url' ; define the URL part
; repeat the above to add any additional parameters or arguments
; Pay attention to the leading space in each command component
'About to run: ' $Cmd ? ; show the command (for debugging)
Run $Cmd ; run the command string This may seem more complicated, but it allows you to pay close attention to each argument/parameter, getting the quotes right, etc. Speaking of quotes, we tend to use single quotes in Kix (especially in this case)because DOS comands usually require double quotes - it's easier to embed the double quotes this way.
Glenn
PS - if you have several consecutive shell commands to run, a BAT file might be the way to go - you can even create it with Kix as you need it. For single commands, use Shell or Run.
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
#190360 - 2008-10-29 01:34 AM
Re: Do I need a .bat file to call a URL?
[Re: Glenn Barnas]
|
Bonfils
Just in Town
Registered: 2008-10-28
Posts: 4
|
Thanks for your quick reply. Just to confirm, seeing I only need to run a single URL could I do the below?
Code: IF @USERID = "Sysadmin" goto end ENDIF
IF INGROUP("Dir-entry-check") = 1
run "c:\Program Files\Internet Explorer\iexplore" http://hww-kingsweb/secure/directory/authenticate/autotest.asp
ENDIF
:END exit
|
|
Top
|
|
|
|
#190372 - 2008-10-29 07:09 PM
Re: Do I need a .bat file to call a URL?
[Re: Glenn Barnas]
|
Bonfils
Just in Town
Registered: 2008-10-28
Posts: 4
|
Hi Glenn,
Worked a treat!! Thanks for helping ;o)
|
|
Top
|
|
|
|
#190380 - 2008-10-29 08:59 PM
Re: Do I need a .bat file to call a URL?
[Re: Lonkero]
|
Bonfils
Just in Town
Registered: 2008-10-28
Posts: 4
|
I take your point ;o)
|
|
Top
|
|
|
|
#190514 - 2008-11-05 09:27 PM
Re: Do I need a .bat file to call a URL?
[Re: Glenn Barnas]
|
MattColeman
Fresh Scripter
Registered: 2008-05-19
Posts: 12
Loc: Kitchener-Waterloo, ON
|
I'm all about clean and easy scripts - so I use the following command:
RUN "C:\Program Files\Internet Explorer\iexplore.exe http://portal"
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 271 anonymous users online.
|
|
|