473,657 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trailing space in argument of Runtime.getRunt ime().exec(arg[]),

aa
Anybody know the solution to trailing space in argument of
Runtime.getRunt ime().exec(arg[]),
Process p = Runtime.getRunt ime().exec("run dll32 url.dll,FilePro tocolHandler
C:\\Documents and Settings\\XX\\D esktop\\- Copy of TestingFolder -\\jjjj
hihi.doc");

where there is 2 space between dash and "Copy of TestingFolder", but after
going through Runtime.getRunt ime().exec(arg[]), it chopes off one space and
make me can't open the file.

Any help, anyone experienced it before, thank you.
Jul 17 '05 #1
1 9031
On Wed, 13 Aug 2003 18:17:23 +0800, "aa" <aa@aa.com> two-finger typed:
Anybody know the solution to trailing space in argument of
Runtime.getRun time().exec(arg[]),
Process p = Runtime.getRunt ime().exec("run dll32 url.dll,FilePro tocolHandler
C:\\Document s and Settings\\XX\\D esktop\\- Copy of TestingFolder -\\jjjj
hihi.doc");

where there is 2 space between dash and "Copy of TestingFolder", but after
going through Runtime.getRunt ime().exec(arg[]), it chopes off one space and
make me can't open the file.

Any help, anyone experienced it before, thank you.


Looks to me like you forgot the extra quotes around the argument starting
with C:
If you do Start -> Run and type the line there, it would look to rundll32
as if you gave five arguments, not the one. The same happens with exec().
Both see a total of 6 parameters:
url.dll,FilePro tocolHandler
C:\\Documents and Settings\\XX\\D esktop\\-
Copy
of
TestingFolder
-\\jjjjhihi.doc

With quotes it would look like this:

Process p = Runtime.getRunt ime().exec("run dll32 url.dll,FilePro tocolHandler
\"C:\\Docume nts and Settings\\XX\\D esktop\\- Copy of TestingFolder -\\jjjj
hihi.doc\"");

And both exec (I hope) as well as rundll32 see the entire file location as
a single parameter.
Cheers.
Jul 17 '05 #2

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

Similar topics

3
1772
by: Frank Bechmann | last post by:
Eventually most of you will not learn much from this because it's just another event in the 'default argument value gotcha' series, but because it cost me some hours yesterday to spot this 'error' in a famous python tool I thought it might still help other people to save some time. I tried to use some method which was documented to write to 'sys.stdout' per default so that changing 'sys.stdout' to bind to another object should allow to...
8
11359
by: vpadial | last post by:
Hello, I want to build a library to help exporting c++ functions to a scripting languagge. The scripting language provides a function to register functions like: ANY f0() ANY f1(ANY) ANY f2(ANY, ANY) ANY f3(ANY, ANY, ANY)
2
10345
by: Marty Meyers | last post by:
I have the following line in a php file: $msg= exec("perl $scriptPath/insert.pl $d $u $t 2>&1", $returnVal); Can someone explain the "2>&1" argument? Second problem, this same line of code when run from the unix command line returns the following error:
20
1951
by: Chris | last post by:
I'm not sure if this has been done before, but I couldn't easily find any prior work on Google, so here I present a simple decorator for documenting and verifying the type of function arguments. Feedback/suggestions/criticism is welcome. ''' 2006.12.21 Created. ''' import unittest
7
2472
by: desktop | last post by:
This page: http://www.eptacom.net/pubblicazioni/pub_eng/mdisp.html start with the line: "Virtual functions allow polymorphism on a single argument". What does that exactly mean? I guess it has nothing to do with making multiple arguments in a declaration like:
6
1612
by: Marshall T. Vandegrift | last post by:
Hi, I'm trying to write a decorator which allows one to produce simple coroutines by just writing a function as a generator expression which re-receives it's arguments as a tuple from each yield. For example: @coroutine def nextn(n=1): values = for i in itertools.count():
2
3360
by: jerry chapman | last post by:
I am trying to send a command to windows from my java program, and I get an error. The pertinent (?) part of my code follows: public boolean action(Event evt, Object arg) { if (arg.equals("Execute")){ inputText=(String)commandText.getText(); System.out.println(inputText); try{ Runtime rt = Runtime.getRuntime(); //Process cp1=Runtime.getRuntime().exec(inputText);
0
8397
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
8827
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
8732
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...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6167
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
5632
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
4158
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...
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
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.