Re: not found
by choroba (Cardinal) on Nov 13, 2024 at 08:59 UTC
|
How exactly do you call the program from the command line and from what folder?
How exactly do you call the program via system, what's the current working directory at that moment?
What do you mean "Perl script is activated via google chrome"? Are you running a local webserver?
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] |
Re: not found
by LanX (Saint) on Nov 13, 2024 at 09:05 UTC
|
not found very often just means the initial path is not set.
Either correct your PATH setting for your CGI or use a full path.
On a side note:
Using system inside a web application is a top vulnerability risk if the input isn't checked. I hope you know what you're doing.
| [reply] [d/l] |
Re: not found
by stevieb (Canon) on Nov 13, 2024 at 08:56 UTC
|
Are you serious?
What are you after here? You have shown no effort at all to follow even reasonable etiquette for any technical review site, let alone this one.
Code, in <code></code> tags. Version of Perl. Expected output.
Sheesh. Re-read your post. Ask yourself this... if you sent verbatim what you posted here to anyone else on the planet, what type of response do you think you'd get?
Go send this exact request to Google. I'm sure they'll help.
| [reply] [d/l] |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Re: not found
by harangzsolt33 (Deacon) on Nov 13, 2024 at 13:27 UTC
|
If you can execute the program from command line in Windows 10, then I am pretty sure that you are either in the directory where this program is located or the program is in the path. So, just type the word "PATH" and press enter. See what it says. The program should be in one of those paths listed. They are separated by a semicolon. Or if it's not, then type "CD" and press Enter. It will give you the current directory and just see if it's there. Type "DIR *.EXE /P" to see what program files you have in the current directory. So, once you locate the program, then you have to execute it using full path. For example, system("C:\\MyProgram\\myprog.exe"); Don't forget to put double \\ because \ is an escape character, it must be doubled for it to produce a single \
For example, the following perl program line will launch Microsoft Word on my PC:
system("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE");
When I try the same in JSScript, an interesting thing happens... Hmmm..
// This doesn't work for some reason:
// new ActiveXObject("WScript.Shell").Run("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE");
// This one works.
new ActiveXObject("WScript.Shell").Run("C:\\PROGRA~1\\MICROS~2\\OFFICE11\\WINWORD.EXE");
Well, this is quite lame. It appears that if your folder or program name has spaces in it or is longer than 8+3 characters that is standard in DOS, then the program must be referred to by its 8+3 name. This is beyond stupid, but this could be the reason why you can't launch the program from JS.
| [reply] |
|
Don't forget to put double \\ because \ is an escape character, it must be doubled for it to produce a single \
Ignoring all the rest of that but you could avoid interpolation by using single quotes.
| [reply] |
|
Escapes are not a matter of interpolation.
Even inside single quotes you'll need to double backslashes, otherwise it wouldn't be possible to escape a single quote.
Consider 'O\'Reilly'
Probably you are confusing it with the worse "slasheritis" in other languages.
| [reply] [d/l] |
|
|
|
|