Problems with spaces in file or directory names and Word.exe

Hi
I'm trying to open a file with Word from my java aplication, and I have a problem with some file/directory names.
I have this
String cmd = "c:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE" + " " + path;
try {
Runtime.getRuntime().exec(cmd);
} catch (Exception errorea){ }
Here is what happens:
if path is something like this: "c:\people\info.doc" , there's no problem, Word opens the document, but if path contains blank spaces somewhere, it doesn't work. For example:
path = "c:\Documents and Settings\info.doc"
path = "c:\Hi everybody\info.doc"
path = "c:\tests\test results.doc"
with the above examples it doesn't work :( Word tries to open "c:\Documents", "c:\Hi" or "c:\tests\test".
Can anyone help? thanx a lot ! : )

Hint: use the variant Runtime.exec(String[] args).
Create a command array, with each token in a separate argument. The entire filename with spaces goes into one argument.

Similar Messages

  • Problems with spaces in directory or file names and Word.exe

    Hi
    I'm trying to open a file with Word from my java aplication, and I have a problem with some file/directory names.
    I have this
    String cmd = "c:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE" + " " + path;
    try {
    Runtime.getRuntime().exec(cmd);
    } catch (Exception errorea){ }
    Here is what happens:
    if path is something like this: "c:\people\info.doc" , there's no problem, Word opens the document, but if path contains blank spaces somewhere, it doesn't work. For example:
    path = "c:\Documents and Settings\info.doc"
    path = "c:\Hi everybody\info.doc"
    path = "c:\tests\test results.doc"
    with the above examples it doesn't work :( Word tries to open "c:\Documents", "c:\Hi" or "c:\tests\test".
    Can anyone help? thanx a lot ! : )

    No, the exec method runs the Word.weird, it shouldn't, and it wouldn't on my system going by the test I just made, but I'm running linux & not windows, maybe the command line parsing is different for some reason.
    The problem is that
    Word starts and then Word says that it can't open the
    file because the name or the path to the file is not
    valid.You still should use the overload that takes a String array.

  • Problem with loading XML file from directory.

    Hello everyone.
    *1)* I have directory defined by DBA. I have read, write privileges. I can read file from this directory using UTL_FILE, I can create file in this directory using UTL_FILE. I tried many times and it does not seem to be any problems.
    *2)* I have very simple XML table (with just one column of xmltype). I can insert into this column using:
    insert into temp_xml values (
    Xmltype ('<something></something>')
    *3)* When executing
    insert into temp_xml values (
    Xmltype (
    bfilename('XML_LOCATION', 'sample.xml'),
    nls_charset_id('AL16UTF8')
    I'm receiving an error:
    Error report:
    SQL Error: ORA-22288: file or LOB operation FILEOPEN failed
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at line 1
    22288. 00000 - "file or LOB operation %s failed\n%s"
    *Cause:    The operation attempted on the file or LOB failed.
    *Action:   See the next error message in the error stack for more detailed
    information. Also, verify that the file or LOB exists and that
    the necessary privileges are set for the specified operation. If
    the error still persists, report the error to the DBA.
    *4)* Previously I was receiving more descriptive errors like permission denied, file not exists etc. This time there is no clear description apart from "file or LOB operation %s failed\n%s". I'm sure I can access this file in this directory (I used UTL_FILE to dbms_output the content).
    Any help would be greatly appreciated.
    Regards
    Marcin Jankowski

    Hi Marcin,
    Welcome to the forums.
    One very important thing with Oracle XML : please always give your database version, all four digits (e.g. 10.2.0.4).
    Does the directory resides on the same machine as the database? Which OS?
    Does any of the following work ?
    DECLARE
       v_lob   CLOB;
       v_file  BFILE;
    BEGIN
       v_file := BFILENAME('XML_LOCATION','sample.xml');
       DBMS_LOB.createtemporary(v_lob, true);
       DBMS_LOB.fileopen(v_file);
       DBMS_LOB.loadfromfile(v_lob, v_file, DBMS_LOB.getlength(v_file));
       INSERT INTO temp_xml VALUES( xmltype(v_lob) );
       DBMS_LOB.fileclose(v_file);
       DBMS_LOB.freetemporary(v_lob);
    END;
    DECLARE
       v_lob   CLOB;
    BEGIN
       v_lob := DBMS_XSLPROCESSOR.read2clob('XML_LOCATION', 'sample.xml', nls_charset_id('AL16UTF8'));
       INSERT INTO temp_xml VALUES( xmltype(v_lob) );
    END;
    /

  • Problem with reading config file

    Hello,
    I have problem with reading config file from the same dir as class is. Situation is:
    I have servlet which working with DB, and in confing file (config.pirms) are all info about connection (drivers, users, passw, etc.). Everything work fine if I hardcoded like:
    configFileName = "C:\\config.pirms";I need to avoid such hardcoding, I tryied to use:
    configFileName = Pirms.class.getClassLoader().getResourceAsStream ("/prj/config.pirms").toString();but it isn't work.
    My config file is in the same directory as Pirms.class (C:\apache-tomcat-5.5.17\webapps\ROOT\WEB-INF\classes\prj)
    Also I tryied BundledResources, it isn't work fo me also.
    Can anybody help me to solve this problem? with any examples or other stuff?
    Thanks in advance.
    Andrew

    Thanks, but I am getting error that "non-static method getServletConfig() cannot be referenced from a static context"
    Maybe is it possibility to use <init-param> into web.xml file like:
    <init-param>
      <param-name>configFile</param-name>
      <param-value>/prj/config.pirms</param-value>
    </init-param>If yes can anybody explain how to do that?
    I need to have that file for:
    FileReader readFile = new FileReader(configFile);Thanks in advance.

  • Problem with Spaces that started with Snow Leopard

    I've noticed two problems with Spaces that have arrived since switching to Snow Leopard... First, if I am in say Space 1 where I use Safari and I then want to move over to an open application, say like Excel, that I have running in Space 4, there are a number of ways to get there but one way I used to use all the time was to move down to the Dock and simply single click on the open Excel application and that would immediately switch me over to Space 4 and whatever Excel documents were already open there... Now, since switching to SL, a single click of whatever application in the Dock makes that application active in the Finder (you see its name appear in the upper left of the menu bar) but otherwise nothing happens... You then have to click a second time and then you switch over to Space 4... It's not really a double click because that implies to clicks closely spaced in time... For this, you can click once, leave the room, come back, click a second time and you will now switch to the alternate space where the open application is running... That is clearly different than it was under Leopard and I would suggest that it is a bug because there is no value in the outcome of that first click... It highlights the switched application but doesn't actually switch to it until you click a second time...
    Second, and this one is worse, if you say launch Excel (which you want to open in Space 4) while you are in Space 1, Excel will open and switch over to Space 4... So far so good... But now, with Excel open over in Space 4, if you are now back and working in Space 1 and while there you use the Finder to go to some other, currently unopened, Excel file and request that it open, it should switch over to Space 4 and open that file but instead it opens it wherever you are, in the case mentioned here, in Space 1... So now you have Excel files opened both in Spaces 1 and 4... Clearly a bug... Spaces had some similar issues in a few early versions of Leopard but they eventually got it working... Now it appears Spaces has regressed somewhat in SL... I love spaces and use it all the time... Hope it gets fixed soon... thanks... bob...

    Hi... I have since learned that the first paragraph of my original post where I say,
    "I've noticed two problems with Spaces that have arrived since switching to Snow Leopard... First, if I am in say Space 1 where I use Safari and I then want to move over to an open application, say like Excel, that I have running in Space 4, there are a number of ways to get there but one way I used to use all the time was to move down to the Dock and simply single click on the open Excel application and that would immediately switch me over to Space 4 and whatever Excel documents were already open there... Now, since switching to SL, a single click of whatever application in the Dock makes that application active in the Finder (you see its name appear in the upper left of the menu bar) but otherwise nothing happens... You then have to click a second time and then you switch over to Space 4... It's not really a double click because that implies to clicks closely spaced in time... For this, you can click once, leave the room, come back, click a second time and you will now switch to the alternate space where the open application is running... That is clearly different than it was under Leopard and I would suggest that it is a bug because there is no value in the outcome of that first click... It highlights the switched application but doesn't actually switch to it until you click a second time... "
    ...that turned out to be my mistake... In another post someone pointed out that in Spaces preferences you must have checked ON the preference that says,
    "When switching to an application, switch to a space with open windows for the application"...
    I had been playing with a number of things trying to figure out what was going on and somewhere in the mix had switched that off... (It is on on all my other computers and I'm sure it originally was on this one too)... When I switched it back on the above described problem went away... So that was my fault...
    But the second part,
    "Second, and this one is worse, if you say launch Excel (which you want to open in Space 4) while you are in Space 1, Excel will open and switch over to Space 4... So far so good... But now, with Excel open over in Space 4, if you are now back and working in Space 1 and while there you use the Finder to go to some other, currently unopened, Excel file and request that it open, it should switch over to Space 4 and open that file but instead it opens it wherever you are, in the case mentioned here, in Space 1... So now you have Excel files opened both in Spaces 1 and 4... Clearly a bug... "
    ...is a real problem... I fired up my G4 (power pc) that runs Leopard, 10.5.8, to see whether it behaves the above way or not and it does NOT... It works as one would expect.. So at least later in Leopard, the above mentioned problem was not present but it is in this first incarnation of Snow Leopard...
    To me, the utility of Spaces is all about keeping a single desktop from being cluttered with many open applications/files and to now have an application that opens in whatever space you happen to be in after it is first opened in its "correct" space sort of defeats the idea behind Spaces... I am currently trying to train myself to first hit <command><4> (my Excel space) before opening a second or subsequent Excel document to prevent it from opening somewhere where I don't want it to be...
    Again, I hope Apple sees and fixes this... I did submit an "Apple feedback" item for this issue... thanks... bob..

  • Error 127: The specified file or directory name is invalid

    Hello,
    I am trying, for the first time, to Groom a users home directory. I had created user Home directory policy and have added vault and groom...

    On 5/14/2013 7:16 AM, nwadmsitn wrote:
    >
    > Hi,
    >
    > I'm trying to evaluate File Reporter. I have installed the agent on a
    > OES11 box. This agent is acting as my proxy agent.
    >
    > Then i setup a policie to scan a volume on 2 differents server. One is
    > OES11, the other is OES2.
    >
    > When i launch my policies i have very differents result :
    > - Volume Free Space : After 5 attempts finally it is working
    > -File System DATA : I have most of the time this error : (127) - The
    > specified file or directory name is invalid. Sometimes Operation is
    > successfull but in the reports i have only data for 1 of the 2 volume
    > and only for 2 directories
    >
    > In the log file of the nfr proxy agent i have this kind of error :
    > 01 2013-05-14 13:00:29 7200 3 0006 5953 7f674b5e0700
    > SRSScanAndCollectFileSystemDataService::FinalizeSc anDataEntry() - Worker
    > thread encountered an error and is exiting, Scan ID = "18", Result = 0.
    >
    > Can someone help me ?
    >
    > Stephane
    >
    >
    Stephane,
    Just to clarify a few things:
    1. Do you get these results for both scan targets? Or only a proxied
    scan of the OES11 or OES2 volume?
    2. What sort of volumes are being scanned? NSS? AFP? NCP? What's the
    underlying Linux filesystem type, if applicable?
    Thanks for helping us understand your problem better.
    - NFMS Support Team

  • DW CS5.5 in OSX Lion - anyone seeing problems with Spaces?

    DW seems to have problems with Spaces in OSX Lion.Switching into DW from other spaces is not 'clean'. When DW comes up, sometimes the Code/Design is blank white, and windows within the workspace don't show their headers. Clicking on Code/Design redraws that window, but the only thing that seems to recover the window headings is switching to and then back from another app in the same Space.
    Seems like screen redrawing triggered by switching apps within the same Space is a little different than that triggered by switching apps across Spaces.
    Anyone else seeing this?

    I did report it as a bug, using the link kindly provided by you and Shocker.
    The two Macs I've tried this on now are a Mac Pro and an iMac, so there's no Automatic Graphics Switching option to enable/disable.
    I was only able to check this out on the iMac late last night.
    Hardware synopsis:
    Mac Pro Early 2009
    Processor  2 x 2.93 GHz Quad-Core Intel Xeon
    Memory  16 GB 1066 MHz DDR3 ECC
    Graphics  NVIDIA GeForce GT 120 512 MB
    Software  Mac OS X Lion 10.7 (11A511)
    The iMac isn't available to me at the moment, I'll have to fill in missing details later (can't remember the exact graphics card info):
    DW is CS5, not CS5.5, was also installed well ahead of the Lion upgrade
    Computer is iMac instead of Mac Pro, about 1.5 years old
    Quad-Core i7
    4GB memory
    Mac OS X Lion 10.7
    I used the same procedure upgrading to Lion on the iMac...
    Ran Cocktail 'Pilot' to clean up the system prior to install (runs Daily, Weekly, Monthly maintenance scripts, clears System, User, and Internet caches, repairs disk permissions on "Macintosh HD", clears log files)
    OS10.7 was purchased through the Mac App Store and installed.
    JRE installed.
    DW on the iMac exhibited the same problem as on the Mac Pro.
    To reproduce:
    Start DW, open a file for editing
    Start any other app in the same Space
    Open a new Space, open any other app there.
    Test switching between DW and other apps in the same Space compared with switching between DW and other apps in different Spaces.
    Consistently, when I switch between DW and other apps in the same Space, DW's windows/panels redraw properly,
    and when I switch between DW and other apps in different Spaces, DW's windows/panels don't redraw properly.

  • Problems with some PDF files

    Hi,
    I have problems with some PDF files. After clicking on link to the file Safari shows me insted of normal document (which is working on Windows) hashes, numbers etc like it was a problem with coding or something. First I was using Preview, I though that maybe installing Acrobat Reader with plugins will solve the problem, but ofcourse it didn't. Did somebody has this same problem?

    Back up all data.
    Please triple-click anywhere in the line below on this page to select it:
    defaults delete -app Safari WebKitOmitPDFSupport
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Quit Safari. Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    Wait for a new line ending in a dollar sign (“$”) to appear below what you entered. You can then quit Terminal. Test.

  • Tempo problems with imported wav files

    Hey everyone, sorry if there's a quick fix for this in the forums that I couldn't find, but I've been having some tempo problems with imported .wav files.
    Long story short, my system couldn't handle playing all the tracks for a song while recording drums, so I bounced out an mp3 of the song and put it in a new Logic file so my drummer could just play along to that as I recorded him. Unfortunately, the original song is at 167 bpm, but I forgot to change the bpm in the new Logic file with the .mp3 file of the song to 167 bpm, so it was left at the default 120 bpm.
    So, the drums were recorded at the correct 167 bpm, but Logic thinks that those new drum .wav files should be played at 120 bpm, so when I import my drum tracks back into the original file, they do not play correctly at all.
    I could get record it all again, but I wanted to check if there was a way I could salvage what I already have, since my drummer lives about an hour away right now and can't just come over whenever he wants.
    Thanks for the help! I really appreciate it.

    Hi,
    First, do not use MP3 in Logic, the sound quality is less than AIFF, WAV or CAF, and Logic has to decode it for playback, making it a heavier burden on the CPU than an uncoded audiofile, such as AIFF, WAV or CAF.
    Secondly, audio files are independent of Logic's tempo. If you bounce down an audio file in any format (other than Apple Loop), it will play back at the same speed, +regardless of Logics' tempo setting+, either at recording or playback. Logic doesn't 'think' anything. The BPM is only important to MIDI tracks, or to the spacing between audio files. The audio files themselves *are not affected* by the tempo setting. If you import an audio file of tempo 167 into a 120 BPM project, the file will still play at 167, only Logic will indicate the wrong bar positions.
    regards, Erik.

  • Problem with preview PDF files on Windows 7 32bit

    Hello,
    in my office I have a problem with preview PDF files on my computers. The files are allright, but if I select a file and click on preview mode after ~ 10sec operation system write something "Preview this file is corrupt for PDF Preview Handler wrong". On other 64bit computers with same programs the preview is work. I try uninstall all Adobe soft (Reader, Flash), clean all Adobe data from folders in root and in register, but it is not solve this problem. On Microsoft forums wrote me, that the problem is probably with AR plugin.
    So, can someone help me?
    Config PC:
    Windows 7 32/64bit Pro
    Intel i3, 4GB
    Adobe Reader 11.0.5
    Adobe Flash Player 15 ActiveX
    Adobe Flash Player 15 plugin
    Preview Handler Surrogate Host ver.: 6.1.7601.17514
    Thank you for help.

    I think I figured it out after reading other forums. Thanks!

  • Problem with printing pdf file

    hello,
    lately i have problem with printing pdf file:
    i click on the print button and the respod is very slow
    it takes more than a minute till the print window apears.
    i tryied to install version X but it's the same, the problem exist only when printing via adobe reader,
    other programs i'd working much faster.
    please advice,
    thank you

    No, it is not set to overprint. Also, I have to add that the printing results were not consistent. Sometimes it covered and sometimes it did not.

  • Problem with uploading a file in Clustered Environment

    Hi,
    I have a problem with uploading a file in a clustered environment. I have an iview component which facilitates an upload action of an xml config file. The problem is that the upload of the modified XML file is reflected only in the central instance of the cluster and not in the dialog instances. The dialog instances hold the old config file.
    Is there any solution to upload the file to all the nodes in the cluster.
    Thanks
    Kiran

    Hi,
    This is a known problem with clustered environment. Remember that your portal component runs on just on dialog instance and it doesn't automatically have access to the other nodes.  However, there are some ways to get around this
    1. Use KM to store files. KM is a common repository for all application servers and therefore you needn't worry more
    2. Use an external batch oriented product (suresync/robocopy) to synch folders on the different DIs. You basically use your existing portal component, but there is a batch job which makes sure the upload folder is identical on all DIs (however, there is a slight delay depending on how often you run the batch job)
    3. Store the files on a shared disk directly from the portal component.
    Cheers
    Dagfinn

  • A problem with copying text from english pdf to a word file

    i have a problem with copying text from english pdf to a word file. the english text of pdf turns to be unknown signs when i copy them to word file .
    i illustrated what i mean in the picture i attached . note that i have adobe acrobat reader 9 . so please help cause i need to copy text to translate it .

    Is this an e-book? Does it allow for copying? It is possible that the pdf file is a scan of a book?

  • Hi, I have problem with importing MOV files from SJCAM 4000. MOV files are in supported formats for Adobe Premiere Elements 11. But if I'm importing MOV file, only audio part is imported, video part is not imported. How can I solve this problem?

    Hi, I have problem with importing MOV files from SJCAM 4000. MOV files are in supported formats for Adobe Premiere Elements 11. But if I'm importing MOV file, only audio part is imported, video part is not imported. How can I solve this problem?

    haben
    From looking at the specifications of your camera (SJCam 4000), we know already what video compression your camera is using. It is H.264.
    A H.264.mov file should be supported by Premiere Elements 11. On what computer operating system is your Premiere Elements 11 running?
    Do you have the latest version of QuickTime installed on your computer? And, are you running QuickTime and Premiere Elements 11 from a
    User Account with administrative privileges? Please go to Premiere Elements 11 Publish+Share/Computer/QuickTime to confirm that you find
    presets there for the QuickTime choice there.
    What are the properties of these H.264.mov files - is it 1080p30 (1920 x 1080p30)  or something else? Do you know if this camera is recording with a variable or
    a constant frame rate?
    Please review and consider and then we will decide what next.
    Thank you.
    ATR

  • Hi! I´m having problems with showing video files in Qlab on my Macbook Air. A sound/video technician told me to "blow out" my Mac. Was told to use  cmd+ r  when restarting. Is this the right way?

    Hi! I´m having problems with showing video files in Qlab on my Macbook Air. It started suddenly. Consulted a sound/video technician who told me to "blow out" my Mac. Was told to use cmd+r  when restarting. Is this the right way to clean up my Mac? And is it likely that some kind of bug is causing problems for Qlab to show video files? I´ve already tried with a bunch of different video files and sometimes Qlab plays them and sometimes not. I need the Qlab playlist for a theatre show and only have a week until showtime so starting to really worry. Is there anyone out there who can help?

    Your Mac runs maintenance in the background for you.
    Command + R gives you access to restore, repair, or reformat the drive using OS X Recovery
    No idea why that was suggested.
    You may have a third party video player installed that's causing an incompatibility issue.
    Check these folders:
    /Library/Internet Plug-Ins/
    /Library/Input Methods/
    /Library/InputManagers/
    /Library/ScriptingAdditions
    ~/Library/Internet Plug-Ins/
    ~/Library/Input Methods/
    ~/Library/InputManagers/
    ~/Library/ScriptingAdditions
    The first four locations listed are in the root-level Library on your hard disk, not the user-level Library in your Home folder.The tilde (~) represents your Home folder.
    To access the Home folder in OS X Lion or Mountain Lion, open the Finder, hold the Option key, and chooseGo > Library.

Maybe you are looking for

  • HP LaserJet 1000 Windows 7 (32/64 bit)?!

    Hi! How long company (HP) will ignore HP LaserJet 1000 users? We need drivers that working on Windows 7!!! Don't try to ask me buy another - new model of HP printer, because mine is work very well!!! HP printers working very well, but in case with dr

  • Activity type and skf calculation

    Dear Forum, I would like to seek advice of the difference of both calculation.  1 skf - 1 big amount allocated to all cost center. if the skf measurement is number of employee, then the cycle will apportion the amount according to the number of emplo

  • Roles in XI

    Hi  I have SAP_ALL and SAP_NEW profile in XI . Do i really need the  some roles to work in IR and ID Regards Vijay

  • When I drag and drop contact from Address book to Entourage, they disappear

    ...within 24 hours or so. This has happened with 3 contacts now. Any ideas where to begin?

  • Lightroom to Elements workflow

    I have a new iMac running 10.4 with 4 gig ram. I plan to begin using Lightroom to organize and enhance photos, and afterward (occasionally) use Elements 6 for more detailed work. Can I set up Lightroom so that when I'm finished adjusting an image, I