adding parameters to a command line to launch a local URL

Post Reply
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

adding parameters to a command line to launch a local URL

Post by Rick Lipkin »

To All

I wish to create a local URL that will launch from an HTML e-mail like Outlook or from a document in Word .. I am testing this on my local machine in Word .. I want to add a /parameter to the end of the command line so I can trap it with the PARAMETERS statement.

PARAMETERS xTEXT line in my code .. unfortunately I can not find the correct syntax to to this ..

This works on my local drive to start the program ...

File:\\c:\fox\doi\leavtrav\leavew32.exe <-- this works

How can I add a /parameter to the end of the above File:\\URL and have it be a part of the command line

File:\\c:\fox\doi\leavtrav\leavew32.exe /projectid=12345

The above line only launches the program and does not pass the /project=12345 ..

What am I missing ??? quotations ??

Thanks
Rick Lipkin
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: adding parameters to a command line to launch a local URL

Post by cnavarro »

Rick, try with
File:\\c:\fox\doi\leavtrav\leavew32.exe?projectid=12345
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Post by Rick Lipkin »

Cristobol

Unfortunately that did not work PARAMETERS returned nil .. I tried it this way too File:\\c:\fox\doi\leavtrav\leavew32.exe%020/projectid=12345 ..

Rick
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Post by Rick Lipkin »

To All

If I create this link \\sales\saliteprod\Leavew32.exe "Rick Lipkin" and run it in Windows Run

Image

my program returns

Image

Here is the code at the top of my program

Code: Select all

PARAMETERS xText
 
xText returns the command line parameters ... So if you can run the above script ( unc ) in the Windows Run command you should be able click on the link and pass the parameter .. instead of the Windows Run..

I would appreciate any input!

Rick Lipkin
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: adding parameters to a command line to launch a local URL

Post by Antonio Linares »

Rick,

Code: Select all

function Main( ... )

   ? hb_AParams()

return nil
live demo:
https://fivetechsoft.github.io/snippets?20200424144640
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Post by Rick Lipkin »

Antonio

Thanks for your quick reply ... I am not having problems with extracting the parameters when you cut and paste the entire link into the Windows Run dialog . I just can not get the parameters to resolve when the link is clicked. .. The executable starts and runs, but does not resolve the parameters .. has to be a syntax to make this work from a click rather than cut and paste.

\\sales\saliteprod\Leavew32.exe "Rick Lipkin"



Thanks
Rick
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Post by Rick Lipkin »

Antonio

I am trying get your suggestion to work by using the function hb_Aparams() .. and as you know it creates an array ... and I have not been successful is evaluating the array

Leavew32 "Rick Lipkin"

Using the above example from the command line ...

Code: Select all

Local aParams,nParamNo

aParams := {}
aParams :=  hb_AParams()

FOR nParamNo := 1 TO LEN( aParams )
   ? nParamNo, aParams[ nParamNo ]
NEXT

 
The above code returns the number 1 .. and not the value of the array element .. I am looking to the result of "Rick Lipkin" .. which was the value of the command line .. appreciate your Help.

Thanks
Rick Lipkin
Post Reply