473,799 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shellexecute path problem even with double quote

4 New Member
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.r un", "C:\axfolde r", 5)

The code below does NOT work:
ShellExecute(0& , "open", "ax.exe", "C:\Documen ts and Settings\jon\De sktop\requiredf iles\2runtemp2. run", "C:\axfolde r", 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 3867
Rabbit
12,516 Recognized Expert Moderator MVP
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.r un", "C:\axfolde r", 5)

The code below does NOT work:
ShellExecute(0& , "open", "ax.exe", "C:\Documen ts and Settings\jon\De sktop\requiredf iles\2runtemp2. run", "C:\axfolde r", 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:\Docum ents and Settings\jon\De sktop\requiredf iles\2runtemp2. run""", "C:\axfolde r", 5)
May 22 '07 #2
JConsulting
603 Recognized Expert Contributor
ShellExecute(0& , "open", "ax.exe", """C:\Docum ents and Settings\jon\De sktop\requiredf iles\2runtemp2. run""", "C:\axfolde r", 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 New Member
The code below does NOT work:
ShellExecute(0& , "open", "ax.exe", "C:\Documen ts and Settings\jon\De sktop\requiredf iles\2runtemp2. run", "C:\axfolde r", 5)
Not sure if this would work .... try using the "short" folder name, ie, "C:\Docume~ 1\" instead of "C:\Documen ts and Settings\" .... ???

James
May 23 '07 #4

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

Similar topics

9
8147
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 from an HTML page on Windows XP/Internet Explorer. The EXE is already locally installed, and the HTML page is also viewed locally on the PC- it's not a web site. I know of two ways to do this, both of which are featured in the sample HTML file at...
0
1836
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, string lpOperation, string lpFile,
0
1599
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, string lpOperation, string lpFile,
1
4139
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 select / browse text file, and Converter.exe is located at the same directory/ folder with this application. I tested that the following is not working well. int ret = (int)ShellExecute(hWnd, "open", "Converter.exe", sztxtBuffer1 ,
4
1889
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 different forum if I made a mistake. In any case, thank you for spending the time to read this loooong case and/or for your input. With that said, here's the background of the situation:
2
1840
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
3024
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", "notepad.exe", NULL, NULL, SW_SHOWNORMAL); RETURN 0; }
2
10743
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 computer is set on. I've searched the web and nothing solid. I did get the following VBA code and it doesn't seem to work. If anyone can help me i'd appreciate it. From the code below txtImageNote is a field on the form that displays the path to...
2
1499
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 that when said folder is double clicked or "open" is selected, it will pop up and request that the user open the readme.doc. The user can then A) skip this option, B) read the file, and C) opt to not see this window again. Based on the code...
0
9688
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
9544
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,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10259
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
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...
1
7570
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...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.