1

I have a script which generates an Email with information based on the computer it was just run on. In the Email there is also a link to another batch file (which runs an exe) that I would only need sometimes, said batch file needs to be executed via the link with a parameter which changes based on information pulled from the first script.

Now if you deciphered any of that, Congratulations.

What I need to know is, is this possible (to run a batch script with parameters from a link) and if so could anyone provide information on this.

4 Answers 4

1

That depends on what kind of data is in the parameters being passed. If it is simple text data, less than 256 characters, you can do so on the command line. Longer parameters may require using an environmental variable. Or worse, text files.

[FirstLevel.script]

SetWindowsEnvironment("CMDLongParm", $ResultString1);
SysCall("f:\batch\sub.cmd \"$ResultString2\"");

[sub.cmd]

@echo off
DoEmail %1 %CMDLongParm% >> Email.Log

Just some pseudo-code examples to show how it is done.

0

Without seeing the format of your link it's not really possible to say yes or no. However, what you could do is pass the entire link as a parameter and have it parsed by the batch file itself to extract the bit of interest.

0

Any chance you could instead have the first script generate a temporary script that hard-codes the changing parameter, and then just send out an e-mail with a link to the temporary copy of the script?

Otherwise, I'm not sure of any obvious ways to include "parameters" in a URL pointing to a script.

(Did I understand your request?)

0

Taking a chance here. Did you find a solution to your (13 year old) problem?

I'm trying to do something similar here. Have a hyperlink in an email, clicking on it opens a batch file to which I'm hoping I can provide a parameter. The batch file will open our application on a certain module, loading an inspection with the parameter name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .