473,385 Members | 1,707 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.

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 6238
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.