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\OP 2\Test1.exe
The parameter is: '\\CL001\mart\o p2\Test' A direct type of this in the URL works:
\\CL001\Mart\OP 2\Test1.exe /p '\\CL001\mart\o p2\Test' However, if I type this (\\CL001\Mart\O P2\Test1.exe /p '\\CL001\mart\o p2\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\M art\OP2\Test1.e xe?'p=\\CL001\m art\op2\Test''" ></A> I've tried various javascripts and manipulations with no success. Anyone have an idea?
Thanks,
cj
13 12841 acoder 16,027
Recognized Expert Moderator MVP
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\OP 2\Test1.exe /p '\\CL001\mart\o p2\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>
acoder 16,027
Recognized Expert Moderator MVP
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.locati on.href.
acoder 16,027
Recognized Expert Moderator MVP
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\OP 2\Test1.exe /p '\\CL001\mart\o p2\Test'
Perhaps you could try passing the string as it works to shell.run.
rnd me 427
Recognized Expert Contributor
[quote=JohnDrive r]
document.locati on.href = document.locati on.href = "\\\\CL001\\Mar t\\OP2\\Test1.e xe%20'"'\\\\CL0 01\mart\op2\Tes t'"'";
</
/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>
rnd me 427
Recognized Expert Contributor
That gives me two errors:
"\\\\BABBROFFIL 001\\Groups\\OP IM\\BrewSchd.ex e%20'"'\\\\BABB ROFFIL001\\Grou ps\\opim\\Sched '"'";
you have nested quotations that are not connected by "+", or escaped.
this is invalid. escape the quotes or connect the substrings...
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 parameter):
SELECT * FROM MyTableFunction(1)
|
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 server ?
Is it possible to use parameters in pass-through queries ?
An additional question: Is it possible to connect to a database on MySQL or
PostgreSQL using ADO ?
Is it possible to execute pass-through queries with parameters, using ADO...
|
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 appear when someone is trying to use it as front-end for real
server database systems such as PostgreSQL or MySQL.
One of these problems is regarding pass-through queries and parameters.
I wanted to have all the code on client, while executing it on...
|
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 it is read-only) .. Is there
any way to make <this> not read-only?
I have simplified the following code. There is a Task class and a Data
Class. I am trying to pass the task class by ref to the data class.
public class Task
{
| |
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 declaration. Here's how the parameter
is described in the context of my ObjectDataSource:
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetArticlesByWhomever"
TypeName="WhateverTableAdapters.WhateverTableAdapter">
|
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 array of data. All four
classes are the same except for the number of elements in their arrays and
the data.
I have a MainClass (the form), which processes all of these arrays. The
MainClass makes use of third party objects to do this. There...
|
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:
session_set_save_handler(array(&$sess_handler, 'open'),
array(&$sess_handler, 'close'), array(&$sess_handler, 'read'),
array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'),
array(&$sess_handler, 'gc'));
|
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 a WebService is that
essentially we are passing an address of an object which resides on the
'local machine' i.e. a local machine object address. Surely when the
WebService method is called and run 'on the server', the reference type will
be...
|
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.
Here is a newbie mistake that I found myself doing (as a newbie), and
that even a master programmer, the guru of this forum, Jon Skeet,
missed! (He knows this I'm sure, but just didn't think this was my
problem; LOL, I am needling him)
If...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |