473,405 Members | 2,294 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,405 software developers and data experts.

Spaces and path

UI
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would like
to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx
Nov 12 '05 #1
3 6495

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & """" & thispath & """", 1)
Terry
"UI" <asd@as> wrote in message
news:3f**********************@dreader5.news.xs4all .nl...
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would like to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx

Nov 12 '05 #2
"UI" <asd@as> wrote in message news:<3f**********************@dreader5.news.xs4al l.nl>...
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would like
to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx


Lx,

try this:
RetVal = Shell("""C:\Program Files\Microsoft Office\Office" & tussen &
_
"\excel.exe """ & thispath & """", 1)

by using double-quotes twice within a string surrounded with
double-quotes the resulting expression gets single double-quotes
around the strings. These double-quotes prevent spaces to be
interpreted as separators for parameters in the command-line.

Marc
Nov 12 '05 #3
UI
Thanks Terry, it did the trick!

Lx

"Terry Kreft" <te*********@mps.co.uk> schreef in bericht
news:bk**********@newsreaderg1.core.theplanet.net. ..

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & """" & thispath & """", 1)
Terry
"UI" <asd@as> wrote in message
news:3f**********************@dreader5.news.xs4all .nl...
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would

like
to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx


Nov 12 '05 #4

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

Similar topics

9
by: Jean-Marc Molina | last post by:
Hello, I can't find a way to execute a Windows application, whose directory path contains blank spaces, from a PHP script. I also wonder if the problem happens under Linux and other OS. ...
9
by: hokiegal99 | last post by:
This script works as I expect, except for the last section. I want the last section to actually remove all spaces from the front and/or end of filenames. For example, a file that was named " test ...
3
by: Jason | last post by:
Here's the code I'm using: #################################### import os, string for root, dirs, files in os.walk('/home/_Comedy'): for file in files: str = os.path.dirname(file) print root,...
1
by: bob | last post by:
I have created a simple Windows service in VB.Net which installs fine using InstallUtil.exe to install it to, for example "c:\test", or "c:\Windows\YellowBanana", but if I install it to "c:\Program...
9
by: sdb1031 | last post by:
I am trying to run an exe within a python script, but I'm having trouble with spaces in the directory name. The following example will display the usage statement of the program, so I know that...
22
by: rtilley | last post by:
# Spaces are present before and after the XXX filename = ' XXX ' new_filename = filename.strip() if new_filename != filename: print filename Macs allow these spaces in file and folder...
2
by: s99999999s2003 | last post by:
hi I am working in unix and i have some directories names with spaces eg ABC DEF A how can i work effectively with spaces in directory/file names in python? sometimes when i do...
3
by: Luke - eat.lemons | last post by:
Hi, Could someone tell me the correct quotation to get around spaces in paths for: Server.MapPath("\\server\share\spaces in name.mdb") I know its bad practice to use spaces but...
2
by: Ken Brubaker | last post by:
Does the xsd.exe command line support paths with spaces? For example the xsd.exe /o: option specifies the output file name. How can I specify an output file path that has a space? I'v tried...
3
by: evenlater | last post by:
I've implemented Bob Larson's frontend auto-updater which runs a batch file that deletes an existing copy of my .accde and then replaces it with a copy of the most recent .accde file. When I run...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.