I need to pass a parameter to an executable either via URL or link or script or whatever but nothing is working.
The .exe is: \\CL001\Mart\OP2\Test1.exe
The parameter is: '\\CL001\mart\op2\Test' A direct type of this in the URL works:
\\CL001\Mart\OP2\Test1.exe /p '\\CL001\mart\op2\Test' However, if I type this (\\CL001\Mart\OP2\Test1.exe /p '\\CL001\mart\op2\Test') into a link for a URL, then the "file:\\" prefix is placed before and file not found error occurs. This opens the app but the parameter is not passed properly:
<A HREF="\\CL001\Mart\OP2\Test1.exe?'p=\\CL001\mart\o p2\Test''"></A> I've tried various javascripts and manipulations with no success. Anyone have an idea?
Thanks,
cj
13 12771
Have you tried setting location.href?
Thanks the response. I have tried location.href but get the error "Object Expected": - <SCRIPT LANGUAGE="javascript">
-
-
function PROCTest() {
-
document.location.href = document.location.href = "\\\\CL001\\Mart\\OP2\\Test1.exe%20'"'\\\\CL001\mart\op2\Test'"'";
-
}
-
-
</SCRIPT>
-
<html>
-
<head>
-
<title></title>
-
</head>
-
<body ONLOAD = 'PROCTest()'>
-
test
-
</body>
-
</html>
Thanks the response. I have tried location.href but get the error "Object Expected": - <SCRIPT LANGUAGE="javascript">
-
-
function PROCTest() {
-
document.location.href = document.location.href = "\\\\CL001\\Mart\\OP2\\Test1.exe%20'"'\\\\CL001\mart\op2\Test'"'";
-
}
-
-
</SCRIPT>
-
<html>
-
<head>
-
<title></title>
-
</head>
-
<body ONLOAD = 'PROCTest()'>
-
test
-
</body>
-
</html>
May be if the application has a command line interface, you can pass arguments using a wshshell object or a batch file. You will be able to return the output of the command if you need.
You can do this in javascript or PHP. Just search for Wshshell for javascript.
I am fairly new to this so please give it a try and if it works please let me know.
Good Luck!
The code below almost works. The app starts up but then will not accept the parameter properly. I get the message that path "\\CL001\\Mart\\op2\\Test" does not exist.
Like I had mentioned before, in the command line I have to use a /p to properly pass the parameter: \\CL001\Mart\OP2\Test1.exe /p '\\CL001\mart\op2\Test' - <HTML>
-
<SCRIPT
-
language = "javascript">
-
function PROCRun() {
-
var shell = new ActiveXObject("WScript.Shell");
-
shell.run( '"\\\\CL001\\Mart\\OP2\\Test1.exe" "\\\\CL001\\Mart\\op2\\Test"' , 1, true );
-
window.close();
-
}
-
</SCRIPT>
-
<BODY
-
ONLOAD='
-
PROCRun();
-
'
-
>
-
</BODY>
-
</HTML>
Thanks the response. I have tried location.href but get the error "Object Expected":
That should be window.location.href or simply location.href, not document.location.href.
The code below almost works. The app starts up but then will not accept the parameter properly. I get the message that path "\\CL001\\Mart\\op2\\Test" does not exist.
Like I had mentioned before, in the command line I have to use a /p to properly pass the parameter: \\CL001\Mart\OP2\Test1.exe /p '\\CL001\mart\op2\Test'
Perhaps you could try passing the string as it works to shell.run.
[quote=JohnDriver]
document.location.href = document.location.href = "\\\\CL001\\Mart\\OP2\\Test1.exe%20'"'\\\\CL001\ma rt\op2\Test'"'";
</
/QUOTE]
that should be window.location.href...
That gives me two errors:
1. Expected ";" @
2. Object Expected @ - <body ONLOAD="PROCTest()">
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
<SCRIPT TYPE = "text/javascript">
-
-
function PROCTest() {
-
window.location.href = "\\\\BABBROFFIL001\\Groups\\OPIM\\BrewSchd.exe%20'"'\\\\BABBROFFIL001\\Groups\\opim\\Sched'"'";
-
}
-
-
</SCRIPT>
-
<html>
-
<head>
-
<title></title>
-
</head>
-
<body ONLOAD="PROCTest()">
-
test
-
</body>
-
</html>
That gives me two errors:
"\\\\BABBROFFIL001\\Groups\\OPIM\\BrewSchd.exe%20' "'\\\\BABBROFFIL001\\Groups\\opim\\Sched'"'";
you have nested quotations that are not connected by "+", or escaped.
this is invalid. escape the quotes or connect the substrings...
hi
I'm very new in this...
I tried in my app something similar (open a shell), currently i'm connecting via localhost and my question is: if i want to run an exe/bat file (using a shell or whatever) on the server, will it work, or do I need to use PHP or something?
similarily, what does the "runat" tag mean exactly?
thanks
Dave
Welcome to TSDN!
I tried in my app something similar (open a shell), currently i'm connecting via localhost and my question is: if i want to run an exe/bat file (using a shell or whatever) on the server, will it work, or do I need to use PHP or something?
If it's on the server, use a server-side scripting language such as PHP, ASP, JSP, Coldfusion, Perl, etc.
similarily, what does the "runat" tag mean exactly?
That sounds like some .NET thing. Either google for it or ask in the .NET forum.
thanks for your response! i'll try
You're welcome and good luck in coding your application!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Yarik |
last post by:
Hello there!
I am working with MS SQL Server 2000.
I have a table function that takes an integer parameter and returns a
table, and I can successfully use it like this (passing a literal
as a...
|
by: Zlatko Matić |
last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL
Server) and that we want to execute some parameterized query as a
pass.through query. How can we pass parameters to the...
|
by: Zlatko Matić |
last post by:
Hi everybody!
Recently I was struggling with client/server issues in MS Access/PostgreSQL
combination.
Although Access is intuitive and easy to use desktop database solution, many
problems...
|
by: Dion Heskett |
last post by:
How can I pass a Class as a parameter to in a method ?
i.e.
Private myMethod( string pram1, Classobject as pram2)
{
Classobject.DataSource = reader;
Classobject.DataBind();
}
|
by: Jay Douglas |
last post by:
Hello, I am needing to pass a class object (this) by reference to a method
in a different class. When I do the following code I get the error (Cannot
pass '<this>' as a ref or out argument because...
|
by: |
last post by:
Hi,
I've defined an ObjectDataSource and a parameterized DataSet. I would like
it if I could pass the parameter value that describes the query that creates
the DataSet as part of a user control...
|
by: Brett |
last post by:
I have several classes that create arrays of data and have certain
properties. Call them A thru D classes, which means there are four. I can
call certain methods in each class and get back an...
|
by: _Mario.lat |
last post by:
Hallo,
I have a little question:
In the function session_set_save_handler I can pass the name of function
which deal with session.
In Xoops code I see the use of this function like that:
...
|
by: David++ |
last post by:
Hi folks,
I would be interested to hear peoples views on whether or not 'pass by
reference' is allowed when using a Web Service method.
The thing that troubles me about pass-by-reference into...
|
by: raylopez99 |
last post by:
Keywords: scope resolution, passing classes between parent and child
forms, parameter constructor method, normal constructor, default
constructor, forward reference, sharing classes between forms....
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |