473,549 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shell command won't work using file server path

RLN
Re: Access 2003/WinXP Pro-SP3

I have a shell command that does not run correctly.

I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb

Pgm1 launches Pgm2 via a command button using a shell command.
The old method ran fine when the specified file server was mapped on
the user's workstation as a drive letter (U)
strAppName = "msaccess.e xe " & "U:\Access_EQ\E Q-NonCorp.MDB"
Call Shell(strAppNam e, 1)

However, hard coding the drive letter in the path is not wise, so I
wanted to specifiy the server this way by its full path:
\\kcnccp50y\Fin ancial Accounting Restricted\Acce ss_EQ\NonCorp\
(Pgm1.mdb uses this path very nicely when importing excel file from
this server, etc.)

When Pgm1 calls Pgm2 (they are in the same folder on the file server)
this does not work:
stAppName = "msaccess.e xe " & "\\kcnccp50y\Fi nancial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB".
Call Shell(strAppNam e, 1)

The error received is:
"The command line you used to start Microsoft Access contains an option
that Microsoft Access doesn't recognize."

Is there a work around for this so I can call another program using the
actual file server share name in lieu of a drive letter (which may or
may not be mapped correctly on every user's workstation?)

Thanks,
RLN

May 18 '06 #1
4 8039

"RLN" <rl************ ***@yahoo.com> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.com.. .
Re: Access 2003/WinXP Pro-SP3

I have a shell command that does not run correctly.

I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb

Pgm1 launches Pgm2 via a command button using a shell command.
The old method ran fine when the specified file server was mapped on
the user's workstation as a drive letter (U)
strAppName = "msaccess.e xe " & "U:\Access_EQ\E Q-NonCorp.MDB"
Call Shell(strAppNam e, 1)

However, hard coding the drive letter in the path is not wise, so I
wanted to specifiy the server this way by its full path:
\\kcnccp50y\Fin ancial Accounting Restricted\Acce ss_EQ\NonCorp\
(Pgm1.mdb uses this path very nicely when importing excel file from
this server, etc.)

When Pgm1 calls Pgm2 (they are in the same folder on the file server)
this does not work:
stAppName = "msaccess.e xe " & "\\kcnccp50y\Fi nancial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB".
Call Shell(strAppNam e, 1)

The error received is:
"The command line you used to start Microsoft Access contains an option
that Microsoft Access doesn't recognize."

Is there a work around for this so I can call another program using the
actual file server share name in lieu of a drive letter (which may or
may not be mapped correctly on every user's workstation?)

Thanks,
RLN


Try adding double quotes around your path so the shell command receives the
path with quotes

stAppName = "msaccess.e xe " & """\\kcnccp50y\ Financial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB""".
May 18 '06 #2
RLN
Try adding double quotes around your path so the shell command receives the
path with quotes


Global Const gblPgmPath = ""\\kcnccp50y\F inancial Accounting
Restricted\Acce ss_EQ\Corp\""
Actually, I have it declared like you see above, but I want to use it
in a variable, 'gblPgmPath' then reference it in various locations in
the application (in Shell statements and other code) like:
stAppName = "msaccess.e xe " & gblPgmPath
The problem here is when I compile, I get an error "Expected
Expression" & the compiler highlights the 2nd forward slash in the
"global const" line of code as I have referenced above.

Due to this error, am I stuck hard coding it in my application like
this:
stAppName = "msaccess.e xe " & """\\kcnccp50y\ Financial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB"""

Thanks.

May 19 '06 #3
Was this a type for your message? In one place it is:

Global Const gblPgmPath = ""\\kcnccp50y\F inancial Accounting
Restricted\Acce ss_EQ\Corp\""
but then later you say it is:

"""\\kcnccp50y\ Financial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB"""

In one place it is \Corp\ in the other place it is \NonCorp\
In one place you include the mdb name in the other palce you do
not..

stAppName = "msaccess.e xe " & gblPgmPath
(without mdb name)

and then:
stAppName = "msaccess.e xe " & """\\kcnccp50y\ Financial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB"""

May 22 '06 #4
RLN

stAppName = "msaccess.e xe " & """\\kcnccp50y\ Financial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB"""

this worked! Thank you.
Ron2006 wrote:
Was this a type for your message? In one place it is:

Global Const gblPgmPath = ""\\kcnccp50y\F inancial Accounting
Restricted\Acce ss_EQ\Corp\""
but then later you say it is:

"""\\kcnccp50y\ Financial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB"""

In one place it is \Corp\ in the other place it is \NonCorp\
In one place you include the mdb name in the other palce you do
not..

stAppName = "msaccess.e xe " & gblPgmPath
(without mdb name)

and then:
stAppName = "msaccess.e xe " & """\\kcnccp50y\ Financial Accounting
Restricted\Acce ss_EQ\NonCorp\E Q-NonCorp.MDB"""


May 23 '06 #5

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

Similar topics

1
4150
by: Joe Blo | last post by:
I have this line in my code that spits out (run time error 53, file not found). Running this program (project.exe) works fine if I do it through the command prompt or Run dialogue box on the Windows XP start menu, but not when using the shell command This is my code dim retval retval =...
6
8367
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the problem is this line: set oCommand = WshShl.Exec(sCommand) (it's about halfway down)  Is there a problem with the Exec method in some versions...
2
4196
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing windows to the front (top) in Netscape, IE and Opera. However, this command does nothing when you access the web page through AOL, even though they say...
2
4539
by: jcrouse | last post by:
I apologize for starting another thread but the old one had a weird subject line. Anyways...here is the code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strInput As String = Application.StartupPath & "\CreateMameGamesCFG.bat" If lblMameExePath.Text <> "" Then
3
5042
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from the network share. It loads in VS2005 fine, and I can edit and save code changes etc, but when I try and Build the solution, I get the following...
6
7634
by: Hugh Janus | last post by:
Hi group, I am executing a shell command that calls a .BAT file. I have to wait for this batch file to finish so I use the wait = true parameter in the shell command. However, this means that my app freezes causing the form is not be refreshed when something goes in front of it and then disappears. This looks ugly and gives the...
2
6937
by: ¹é¿ø¼® | last post by:
Hello, everybody. I want to call any shell command from php script using shell_exec(). The problem is that the next line of the php script would not be run until a few minutes after running the shell command. I found the shell command couldn't be run at background mode. It seemed that the shell_exec() function waits a return from the...
4
2351
by: G. Miller | last post by:
Hey, I'm trying to automate an import routine by using the shell command to call a batch file that will run a vendor export utility before continuing with the import. The problem is that execution seems to want to continue past the shell command once the export routine is launched, which hoses the import. What's the proper method of halting...
34
5310
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> os.startfile("C:\Documents and Settings\Alex\My Documents\My
0
7546
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...
0
7471
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...
0
7985
jinu1996
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...
0
6071
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...
1
5387
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...
0
3517
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...
0
3496
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
784
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...

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.