473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Running Console Application From a .Bat File

I am wanting to invoke a console application by double clicking on a ".Bat"
file from a shared drive. The ".Bat" file will access another shared drive
to actually invoke the application.

The person double clicking on the file has read/write access to both shared
drives.

Can this be done?

In the bat file I attempt to execute the file by suppling a command which
looks like the following:

\\PKCAP208\Ddrive208$\Products\Batch Jobs\MetricBatchLoad\MyPrgm.exe MyParm

It does not seem to like me specifying the drive in this manner. Is there a
way for me to do this in the ".bat" file?
Nov 16 '05 #1
2 2712
I can't find what does this post to do with the C# language... ;)

But I guess you're out of luck. AFAIK, the command line interpreter
(cmd.exe) used for .bat files doesn't handle the UNC paths.

You actually can do something like:

1. copy the file from the network share to a mapped drive
2. run it from there

OR

1. map the share to a letter (a problem here might be finding a free letter)
(NET USE)
2. run it through the letter path
3. remove the mapping

But why not use a link (.lnk) instead?

HTH,
Stefan

"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
I am wanting to invoke a console application by double clicking on a ".Bat"
file from a shared drive. The ".Bat" file will access another shared
drive
to actually invoke the application.

The person double clicking on the file has read/write access to both
shared
drives.

Can this be done?

In the bat file I attempt to execute the file by suppling a command which
looks like the following:

\\PKCAP208\Ddrive208$\Products\Batch Jobs\MetricBatchLoad\MyPrgm.exe
MyParm

It does not seem to like me specifying the drive in this manner. Is there
a
way for me to do this in the ".bat" file?

Nov 16 '05 #2
"Stefan Simek" <si********@kascomp.blah.sk> wrote in message
news:eV**************@TK2MSFTNGP11.phx.gbl...
But I guess you're out of luck. AFAIK, the command line interpreter
(cmd.exe) used for .bat files doesn't handle the UNC paths.
You sure? An empirical test on my machine seems to show otherwise....
He will have to wrap in path in quote, as it has a space in it.:

"\\PKCAP208\Ddrive208$\Products\Batch Jobs\MetricBatchLoad\MyPrgm.exe"
MyParm

--
Truth,
James Curran
[erstwhile VC++ MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
\\PKCAP208\Ddrive208$\Products\Batch Jobs\MetricBatchLoad\MyPrgm.exe
MyParm

It does not seem to like me specifying the drive in this manner. Is there a
way for me to do this in the ".bat" file?


Nov 16 '05 #3

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

Similar topics

2
by: David Olive | last post by:
Hi guys, I'm having a bit of a problem getting a VB .NET console app to run happily as a scheduled task. The app itself generates a bunch of word documents on a file share on another server by...
3
by: No One | last post by:
I have a C# programme that needs to run some of Windows executable files. I first need to check if that programme is already running, and if it is, simply bring the window to the front. How can I...
2
by: MattMenard | last post by:
I've written a C program that I want to run inside an Gui wrapper that I started to write in MFC. I have to select some files then kick off a process running the C program. I have the initial...
4
by: sneffe | last post by:
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a textbox on my form. I cant seem to find an easy way...
4
by: RSH | last post by:
I have an application that creates an Access version of a SQL Server database and then it moves the resulting database to an ftp server for the client to download and run reports against etc. The...
8
by: nadeem_far | last post by:
Hello All, These days I am working on a console application that will register for certain events and do some processing based on the event notification. Now, all the objects are being created...
5
by: plmanikandan | last post by:
Hi, I have written a win32 console application(exname1.exe) which runs for ten minutes.I am calling this exname1.exe from another exe named exname.exe using shellexecuteex.Now from exname.exe...
2
by: tom.sikes | last post by:
We wrote some code (utility stuff) that is intended to run as part of either a windows service, a console app or a windows app. What I'd like to do is when it is running as a service have it log...
1
by: Claire | last post by:
Hi, I'm trying to run mysqldump.exe from my c# application, running on windows vista with visual studio 2005. The following code does not produce the output file. The same line used in a command...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.