473,662 Members | 2,352 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 6271
On Tue, 20 Apr 2004 09:17:27 +0200, "alain" <no*******@wana doo.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\A ccess_2000\Offi ce\Msaccess.exe
C:\Myfolder\mya pplication.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\A ccess_2000\Offi ce\Msaccess.exe
C:\Myfolder\mya pplication.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\A ccess_2000\Offi ce\Msaccess.exe " &
Chr(32) & " C:\Myfolder\mya pplication.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:\Progr am Files\Access_20 00\Office\Msacc ess.exe""" _
& " C:\Myfolder\mya pplication.mdb"

App=Shell(Myapp ,3)
or

const D_QUOTE = """"

MyApp = D_QUOTE & "C:\Program Files\Access_20 00\Office\Msacc ess.exe""" _
& D_QUOTE & " C:\Myfolder\mya pplication.mdb"
App=Shell(Myapp ,3)

Should do it
--
Terry Kreft
MVP Microsoft Access
"alain" <no*******@wana doo.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\A ccess_2000\Offi ce\Msaccess.exe
C:\Myfolder\mya pplication.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
2162
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 them. eventiually i want to generate the xslt from a xml file (all the files and java code are at http://tayek.com/~ray/spy1/). the java code (1.4) does the right thing (it just does the transformation). xmlspy seems really broken when i hit...
6
2156
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 XP Pro SP 1, .Net Framework 1.1) and on our production server (Windows 2K SP 4, .Net Framework 1.1). I have simplified the code and data to isolate the problem. When I use the xsl:strip-space (Line 12) declaration in conjunction with the xsl:sort...
11
1943
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 Element/Text/EndElement. The data for #2 will not be returned. I get a sequence of Element/Whitespace/EndElement. Why is the data (which happens to be spaces) between my start and end tags being misinterpreted?
8
16440
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 & " " & myPath) I want to unzip a file who's path name is defined by the variable myPath and who's file name is defined by the variable myZIPFile, and
12
4546
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 work for the file which is located in a direcotry with a white space? Thanks!
3
2177
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 into problem when there is many spaces in the filename. eg.
7
2635
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 download script, so customers on the website can download MP3s to their harddrive (rather than merely listen to it in their browsers):
2
1617
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 passing the XML to.
9
9359
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 file1 file2 new file file no
0
8432
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
8856
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
8762
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
8633
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
6185
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
5653
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
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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 we have to send another system
2
1747
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.