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

Shellexecute path problem even with double quote

Hi,

I am trying to use ShellExecute function to invoke the ax program.

The code below works perfect:
ShellExecute(0&, "open", "ax.exe", "C:\2runtemp2.run", "C:\axfolder", 5)

The code below does NOT work:
ShellExecute(0&, "open", "ax.exe", "C:\Documents and Settings\jon\Desktop\requiredfiles\2runtemp2.run", "C:\axfolder", 5)


Because of some design issues, the arguement "must" have spaces in its full path. Even though I write the path in double quotations, I can not prevent this error.


Any help on the error is much appreciated. Thanks,
jon
May 22 '07 #1
3 3837
Rabbit
12,516 Expert Mod 8TB
Hi,

I am trying to use ShellExecute function to invoke the ax program.

The code below works perfect:
ShellExecute(0&, "open", "ax.exe", "C:\2runtemp2.run", "C:\axfolder", 5)

The code below does NOT work:
ShellExecute(0&, "open", "ax.exe", "C:\Documents and Settings\jon\Desktop\requiredfiles\2runtemp2.run", "C:\axfolder", 5)


Because of some design issues, the arguement "must" have spaces in its full path. Even though I write the path in double quotations, I can not prevent this error.


Any help on the error is much appreciated. Thanks,
jon
ShellExecute(0&, "open", "ax.exe", """C:\Documents and Settings\jon\Desktop\requiredfiles\2runtemp2.run"" ", "C:\axfolder", 5)
May 22 '07 #2
JConsulting
603 Expert 512MB
ShellExecute(0&, "open", "ax.exe", """C:\Documents and Settings\jon\Desktop\requiredfiles\2runtemp2.run"" ", "C:\axfolder", 5)

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim strPath
  3. Dim retval
  4. strPath = "C:\Documents and Settings\jon\Desktop\requiredfiles\2runtemp2.run"
  5. retval = ShellExecute(0&, "open", "ax.exe", Chr(34) & strPath & Chr(34), "C:\axfolder", 5)
  6.  
may not need the chr(34)...not sure
May 23 '07 #3
jamjar
50
The code below does NOT work:
ShellExecute(0&, "open", "ax.exe", "C:\Documents and Settings\jon\Desktop\requiredfiles\2runtemp2.run", "C:\axfolder", 5)
Not sure if this would work .... try using the "short" folder name, ie, "C:\Docume~1\" instead of "C:\Documents and Settings\" .... ???

James
May 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Josh Mayfield | last post by:
Note: There is considerable background detail here, but I do have three questions, which are clearly marked and appear right before the sample code. I have a legitimate need to launch an EXE...
0
by: the_openFace | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd,...
0
by: the openBack | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd,...
1
by: magix | last post by:
Dear Guru, From Dos Command, I can execute like C:\Converter TextFile.txt or C:\Converter D:\TextFile.txt I wrote an application (using VC++) to call a dos command, where sztxtBuffer1 is the...
4
by: John Smith | last post by:
Hello, I'm not sure if these are the appropriate forums for my question since it is closer to about Visual Studio 2005 than it is about .NET framework. So please pardon me and direct me to a...
2
by: H. Martins | last post by:
Hi. I have the following code: Option Compare Database Public Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, _ ByVal lpOperation As String, _
5
by: =?Utf-8?B?aGtNaWNybw==?= | last post by:
Having problems compiling the following code in C USING CL.EXE // shell.c LANGUAGE = .NET 2003 #include <iostream.h> #include <windows.h> int main() { SHELLEXECUTE(NULL, "open",...
2
by: John Smith | last post by:
Hi, I have an access database form with an image. I'm trying to create an onclick event on the image so that when a user clicks on the image it opens that file with the default viewer the...
2
by: newbess | last post by:
I am completely and totally new to VB so any dumbing down and/or condescension is welcome and expected. I have been charged with the task of creating a prompt window within a folder on our network...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
0
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...

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.