473,396 Members | 1,760 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,396 software developers and data experts.

Shell Path problem

Hello

I am using the Shell command and having problems writing the path of some
arguments

Example:

Dim MyPath as String

MyPath = "C:\Program Files\Microsoft Office\Office\MSAccess.exe C:\Program
Files\MyData.mdb"

A = Shell(MyPath, 1)

Because of the space between (Program) and (Files) in C:\Program
Files\MyData.mdb the Shell

command looks for a database called C:\Program.mdb.

It doesn't seem to mind the space between (Program) and (Files) and

the space between (Microsoft) and (Office) in the path to MSAccess.exe.

I must be missing some brackets or quotation marks in the path that would
allow

Shell to recognize the full path of the mdb.

Thanks

G.Gerard
Dec 7 '06 #1
2 6395
G Gerard wrote:
Hello

I am using the Shell command and having problems writing the path of some
arguments

Example:

Dim MyPath as String

MyPath = "C:\Program Files\Microsoft Office\Office\MSAccess.exe C:\Program
Files\MyData.mdb"

A = Shell(MyPath, 1)

Because of the space between (Program) and (Files) in C:\Program
Files\MyData.mdb the Shell

command looks for a database called C:\Program.mdb.

It doesn't seem to mind the space between (Program) and (Files) and

the space between (Microsoft) and (Office) in the path to MSAccess.exe.

I must be missing some brackets or quotation marks in the path that would
allow

Shell to recognize the full path of the mdb.

Thanks

G.Gerard

Try this.

In the path to Access ("Office" Vs. "Office10") YMMV. Watch for word
wrap and the trailing space in the path to the EXE.

MyPath = "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE " &
"""" & "C:\blahblahblah\MyAccessDB.mdb" & """"
--
Smartin
Dec 8 '06 #2
You need to insert double quotes around the mdb path and name, as this is in
a string you have to double them up, so:-

Dim MyPath as String

MyPath = "C:\Program Files\Microsoft Office\Office\MSAccess.exe ""C:\Program
Files\MyData.mdb"""


--

Terry Kreft
"G Gerard" <gg*****@nbnet.nb.cawrote in message
news:7a*******************@ursa-nb00s0.nbnet.nb.ca...
Hello

I am using the Shell command and having problems writing the path of some
arguments

Example:

Dim MyPath as String

MyPath = "C:\Program Files\Microsoft Office\Office\MSAccess.exe C:\Program
Files\MyData.mdb"

A = Shell(MyPath, 1)

Because of the space between (Program) and (Files) in C:\Program
Files\MyData.mdb the Shell

command looks for a database called C:\Program.mdb.

It doesn't seem to mind the space between (Program) and (Files) and

the space between (Microsoft) and (Office) in the path to MSAccess.exe.

I must be missing some brackets or quotation marks in the path that would
allow

Shell to recognize the full path of the mdb.

Thanks

G.Gerard


Dec 8 '06 #3

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

Similar topics

3
by: John Bowling | last post by:
I have a java (2.0) program with the following lines: String cmdArray1 = {"lp", "-d", "hp4m", "MyFile"}; System.out.println(Runtime.getRuntime().exec(cmdArray1)); It compliles properly, but...
4
by: mailar | last post by:
Hi, I am trying to register my UDF named 'myUDF.sql" (which has @ as its command terminating character) with sample database I am able to do so through the Linux shell prompt using the following...
1
by: Dennis Gaida | last post by:
Hi there, I want to upload some exported reports to a FTP Server, for this I use a command line FTP utility. My Database sits in C:\Documents and Settings\Dennis\My Documents\Database The FTP...
2
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...
6
by: vito | last post by:
how to config the linux to know the path of /usr/bin/php so no need to type it before running a php script every time?
12
by: Dixie | last post by:
Is there a way to shell to Microsoft Word from Access and load a specific template - using VBA? dixie
8
by: Mike | last post by:
Am trying to open a Microsoft Word .doc file using Access 2000 with Shell function (on Windows XP Operating system) Here is the code : Shell "C:\Program Files\Microsoft...
2
by: NasirMunir | last post by:
I am trying to run an executable using shell. The executable look for certain files in the same directory and then run on those files. My problem: I have created a form which asks from the user to...
3
by: Max Vit | last post by:
I have come across a strange issue whilst trying to use a shell command call from Access and have spent some time trying to figure this out but can't find the cause as yet. The issue is: I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...
0
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,...

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.