473,508 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Space in file name

Good morning to you all,
The problem : i use the shell command and i used, with W98, to use the DOS
name when there was a space in the file / folder name ( ex : Program~1 for
Program Files). With XP, I don't find that sort of replacement name when i
run command and then DIR command to reach the DOS names of the files /
folder. How could i do to use correctly the shell command with files /
folders with a space in their name ? Thank you.

--
_______________________________________

Site personnel : http://perso.wanadoo.fr/dimphoto
Nov 12 '05 #1
5 6252
On Tue, 20 Apr 2004 09:17:27 +0200, "alain" <no*******@wanadoo.fr>
wrote:
Good morning to you all,
The problem : i use the shell command and i used, with W98, to use the DOS
name when there was a space in the file / folder name ( ex : Program~1 for
Program Files). With XP, I don't find that sort of replacement name when i
run command and then DIR command to reach the DOS names of the files /
folder. How could i do to use correctly the shell command with files /
folders with a space in their name ? Thank you.


Try enclosing the name of the file (with the complete path) within
quotes.

mike
Nov 12 '05 #2
Mike,
I proceeded so :
Dim Myapp as string
Dim App as variant
Myapp = "C:\Program~1\Access_2000\Office\Msaccess.exe
C:\Myfolder\myapplication.exe"
App=Shell(Myapp,3)

It worked fine with W98, but not with XP. XP seems not to know "Program~1"
for "program files" and to refuse the space if i use "Program Files"
--
_______________________________________

Site personnel : http://perso.wanadoo.fr/dimphoto
Nov 12 '05 #3
alain wrote:
Mike,
I proceeded so :
Dim Myapp as string
Dim App as variant
Myapp = "C:\Program~1\Access_2000\Office\Msaccess.exe
C:\Myfolder\myapplication.exe"
App=Shell(Myapp,3)

It worked fine with W98, but not with XP. XP seems not to know
"Program~1" for "program files" and to refuse the space if i use
"Program Files"


The filename would be "progra~1 ", 8 characters in MSDOS names :)

Add extra quotes... (I think you need extra quotes around each part, the
program and the command-line argument if they have any spaces in the
names)

eg..

Myapp = Chr(32) & "C:\Program~1\Access_2000\Office\Msaccess.exe" &
Chr(32) & " C:\Myfolder\myapplication.exe"

--
regards,

Bradley
Nov 12 '05 #4

You need to embed the quotes in the string, to do this you double them up

so either

MyApp = """C:\Program Files\Access_2000\Office\Msaccess.exe""" _
& " C:\Myfolder\myapplication.mdb"

App=Shell(Myapp,3)
or

const D_QUOTE = """"

MyApp = D_QUOTE & "C:\Program Files\Access_2000\Office\Msaccess.exe""" _
& D_QUOTE & " C:\Myfolder\myapplication.mdb"
App=Shell(Myapp,3)

Should do it
--
Terry Kreft
MVP Microsoft Access
"alain" <no*******@wanadoo.fr> wrote in message
news:c6**********@news-reader2.wanadoo.fr...
Mike,
I proceeded so :
Dim Myapp as string
Dim App as variant
Myapp = "C:\Program~1\Access_2000\Office\Msaccess.exe
C:\Myfolder\myapplication.exe"
App=Shell(Myapp,3)

It worked fine with W98, but not with XP. XP seems not to know "Program~1"
for "program files" and to refuse the space if i use "Program Files"
--
_______________________________________

Site personnel : http://perso.wanadoo.fr/dimphoto

Nov 12 '05 #5
I wil try; Thank you to all.

Alan

--
_______________________________________

Site personnel : http://perso.wanadoo.fr/dimphoto
Nov 12 '05 #6

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

Similar topics

0
2150
by: Ray Tayek | last post by:
hi, trying to convert some csv files into xsml and pulling a few hairs out :(. using the files below. a java program will parse the csv and take care of strange names and notes that line breaks in...
6
2139
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows...
11
1922
by: kenneth | last post by:
I just ran across this. #1 <DBColumn> 1 </DBColumn> #2 <DBColumn> </DBColumn> The data for #1 will be parsed and returned as " 1 ". I get a sequence of...
8
16431
by: Dave G | last post by:
I know this is an old favourite but I can't find a simple answer to a simple question. I'm trying to run this: shell("c:\program files\pkware\pkzipc\pkzipc.exe -ext " & myPath & myZIPFile & "...
12
4523
by: snow | last post by:
Hi All, I noticed if file path has a white space, for example "C:\my document \test.txt", the function File.Exists(filePath) always return false in release mode. How could I make this function...
3
2164
by: skyy | last post by:
Hi.. i have a string that i would want split on a single blank space only. eg. $string = File: abc.txt using split with white space i can get the name of the file : abc.txt However i run...
7
2609
by: lawrence k | last post by:
I've got a music studio for a client. Their whole studio is run with Macintosh computers. Macintosh computers allow file names to have open white spaces, such as "animal hospital.mp3". I have a...
2
1612
by: Joseph J. Kesselman | last post by:
Gabe wrote: You can do exactly that, exactly as you've shown it: <nameJohn Smith</name> But... Now you aren't talking about XML -- you're talking about the behavior of the tool you're...
9
9347
by: ashokd001 | last post by:
Hi I am faceing a problem with a space in file name. I want to write a script which will open a file that file contain others file name, among them few file name contain space. >cat checkfile...
0
7120
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
7380
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...
0
7494
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
5626
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,...
1
5050
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...
0
4706
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...
0
3192
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...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.