473,806 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

run batch file in client side

Hi,
I want to run the batch file from the client side. I was able to do it
in the server side by using process. But i want to run from the client
side , like we do in asp using createobject("w script.shell").

I tried the same code by using the html control and the client side
code, but it gives me the error in createobject statement.

Is there any way to run the batch files in the client, could some one
help me with the code....

Thanks in advance,
Viki
Nov 18 '05 #1
6 9473
Hi,

Are you trying to run commands on the users machine via scripting commands
inside of a webpage?

Firstly, this would only work if the user is running Internet Explorer as a
browser.

Secondly, you would still run in to serious security/permission issues. For
safety, IE will not let untrusted webpages access to such powerfull objects
as "wscript.shell" .

-- David
"viki" wrote:
Hi,
I want to run the batch file from the client side. I was able to do it
in the server side by using process. But i want to run from the client
side , like we do in asp using createobject("w script.shell").

I tried the same code by using the html control and the client side
code, but it gives me the error in createobject statement.

Is there any way to run the batch files in the client, could some one
help me with the code....

Thanks in advance,
Viki

Nov 18 '05 #2
Hi David,
Thanks for the reply, yes i want run the commands on the users machine
.. This is a intranet web , and everyone are using IE.

Could u please explain me how could i do this and what is the
security/permission issues i have to overcome inorder to do this...

Thanks,
Viki
"David" <Da***@discussi ons.microsoft.c om> wrote in message news:<54******* *************** ************@mi crosoft.com>...
Hi,

Are you trying to run commands on the users machine via scripting commands
inside of a webpage?

Firstly, this would only work if the user is running Internet Explorer as a
browser.

Secondly, you would still run in to serious security/permission issues. For
safety, IE will not let untrusted webpages access to such powerfull objects
as "wscript.shell" .

-- David

Nov 18 '05 #3
You can try this,
<SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
function executeCommands ()
{
// Instantiate the Shell object and invoke
//its execute method.

var oShell = new ActiveXObject(" Shell.Applicati on");

var commandtoRun = "Applicatio n Path";

// Invoke the execute method.
oShell.ShellExe cute(commandtoR un, "", "", "open", "1");
}
</SCRIPT>
--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"viki" <fr**********@y ahoo.ca> wrote in message
news:de******** *************** ***@posting.goo gle.com...
Hi David,
Thanks for the reply, yes i want run the commands on the users machine
. This is a intranet web , and everyone are using IE.

Could u please explain me how could i do this and what is the
security/permission issues i have to overcome inorder to do this...

Thanks,
Viki
"David" <Da***@discussi ons.microsoft.c om> wrote in message

news:<54******* *************** ************@mi crosoft.com>...
Hi,

Are you trying to run commands on the users machine via scripting commands inside of a webpage?

Firstly, this would only work if the user is running Internet Explorer as a browser.

Secondly, you would still run in to serious security/permission issues. For safety, IE will not let untrusted webpages access to such powerfull objects as "wscript.shell" .

-- David

Nov 18 '05 #4
Hi Saravana,
I got it, Thanks a lot.

Now i am going to ask u another help. Actually i am executing this on
a web control, i want the server side on click event to wait until the
client side onclick event(shell execute) finishes the processing...

thanks in advance,
Viki

"Saravana" <sa******@sct.c o.in> wrote in message news:<eH******* **********@news .cpqcorp.net>.. .
You can try this,
<SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
function executeCommands ()
{
// Instantiate the Shell object and invoke
//its execute method.

var oShell = new ActiveXObject(" Shell.Applicati on");

var commandtoRun = "Applicatio n Path";

// Invoke the execute method.
oShell.ShellExe cute(commandtoR un, "", "", "open", "1");
}
</SCRIPT>
--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

Nov 18 '05 #5
I dont think it is possible to make server side code to wait till client
side code executes. What you can do is, do all your server work in
serverside onclick event. Finally in that event, use
page.registerst artupscript method to register client side code which has to
be executed when the page is rendered. If you need more details, then get
back to me.

--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"viki" <fr**********@y ahoo.ca> wrote in message
news:de******** *************** ***@posting.goo gle.com...
Hi Saravana,
I got it, Thanks a lot.

Now i am going to ask u another help. Actually i am executing this on
a web control, i want the server side on click event to wait until the
client side onclick event(shell execute) finishes the processing...

thanks in advance,
Viki

"Saravana" <sa******@sct.c o.in> wrote in message

news:<eH******* **********@news .cpqcorp.net>.. .
You can try this,
<SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
function executeCommands ()
{
// Instantiate the Shell object and invoke
//its execute method.

var oShell = new ActiveXObject(" Shell.Applicati on");

var commandtoRun = "Applicatio n Path";

// Invoke the execute method.
oShell.ShellExe cute(commandtoR un, "", "", "open", "1");
}
</SCRIPT>
--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

Nov 18 '05 #6
Thanks Saravana, I will give a try ...

viki
"Saravana" <sa******@sct.c o.in> wrote in message news:<M2******* **********@news .cpqcorp.net>.. .
I dont think it is possible to make server side code to wait till client
side code executes. What you can do is, do all your server work in
serverside onclick event. Finally in that event, use
page.registerst artupscript method to register client side code which has to
be executed when the page is rendered. If you need more details, then get
back to me.

--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
15867
by: Monica J. Braverman | last post by:
My client will be receiving a .dbf file which needs to be uploaded into a sql server database table (as an append) every week. They are NOT computer savvy and I would like to automate this process rather than go into enterprise manager and run data transformation. Is there any way to write a batch file or a set of command lines which will do this? Thanks.
5
2055
by: Tyler Hudson | last post by:
After reading Erland Sommarskog's most enlightening articles on SQL Server 2000's error handling capabilities (http://www.sommarskog.se/error-handling-I.html and http://www.sommarskog.se/error-handling-II.html) I have a question regarding batch cancellation caused by a client. Because a batch cancel request from a client does not cause a rollback, is there any danger of the commands that were executed in the batch before the client...
6
11240
by: Charles Neitzel | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running programs and executing registry entries. The majority of my buttons work however, I have come upon a problem. I need a few of the buttons to run DOS batch files, the batch files in turn run program installers (specifically windows update runtime .exe...
4
2463
by: Z0gS | last post by:
I use the following code to run a batch file on the server side but it not working. The code is working fine on a c# window console program. Can anyone help me? Process myProcess = new Process() myProcess.StartInfo.FileName = "C:\\mapDrv.bat" myProcess.StartInfo.CreateNoWindow = true myProcess.Start();
4
3911
by: Michael | last post by:
I am trying to open a file on the client machine from an aspx page running server side. The design requirements of the page specify that the HtmlInputFile control is not to be used. Since the HtmlInputFile has an HttpPostedFile object containing the client side path to the selected file, there must be some way to resolve this path server side allowing me to open the file with as Stream object.. I've been looking at WebClient.OpenRead,...
1
5405
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
16
2752
by: Richard Maher | last post by:
Hi, I have this Applet-hosted Socket connection to my server and in an ONevent/function I am retrieving all these lovely rows from the server and inserting them into the Select-List. (The on screen appearance of the Select List grows for the first 5 rows then the scroll bar appears if there's more). So far so good. . . The problem is that none of the rows I'm inserting appear on the screen until I have RETURNed from my function; so If...
3
2274
by: Mandragon03 | last post by:
I am using php 5.2.5 via a wamp server on my machine. I have created a web interface to a mysql database using php. The web interface has a link to a php file which calls a dos batch file like this: $Text = shell_exec("c:\mydatabase\convertdb.bat $Language"); where $Language is set to "English" or "Chinese" etc etc ( I verified that it has the correct value ). The batch file contains a call to mysqldump.exe.
14
12835
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in case it's a question, i want to popup a messageBox or something, and bring back to the batch file the result (Yes\No question). I know how to excute the batch file and get all the Standard output at the end, but i don't know who can i read it line by...
0
9719
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9597
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,...
1
10371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
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...
0
9187
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.