Results 1 to 5 of 5

Thread: Problum decompile chm file with spaces in filename.

  1. #1

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    629

    Problum decompile chm file with spaces in filename.

    hi I made some code to decompile chm files. I use hh.exe to decompile the file.
    It works fine but if there is any spaces in the filename it just does not decompile.
    I have even tried putting quotes around the file name with any luck any idea,s

    Here the code I done.

    Code:
                Process p = new System.Diagnostics.Process();
    
                p.StartInfo.FileName = "hh.exe";
                p.StartInfo.Arguments = "-decompile " + txtoutput.Text + " " + txtInput.Text;
    
                try
                {
                    p.Start();
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }
    txtoutput.Text is were the chm get's decompiled to
    txtInput is the input filename.

    Thanks.

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Problum decompile chm file with spaces in filename.

    If you run hh.exe manually with a file path with spaces in it, does it work?

    If it does, then putting quotes around txtInput should work.

    Code:
    Process p = new System.Diagnostics.Process();
    
                p.StartInfo.FileName = "hh.exe";
                p.StartInfo.Arguments = "-decompile " + txtoutput.Text + " \"" + txtInput.Text + "\"";
    
                try
                {
                    p.Start();
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }

  3. #3

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    629

    Re: Problum decompile chm file with spaces in filename.

    No I tried with quotes in the path and with out if a file is called test.chm then it work but if it's called te st.chm does not work even with and without quotes. not sure I even tryed converting the path to a DOS path and no luck. Only way I can think of is making a copy of the file replacing the spaces with underscores then running hh.exe on that.

  4. #4
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Problum decompile chm file with spaces in filename.

    So if you go into the command prompt and run hh.exe (not running it through your code) with "te st.chm" does it work as expected?

  5. #5

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    629

    Re: Problum decompile chm file with spaces in filename.

    no same result does not decompile seems hh.exe does not like spaces in the file name or the path full stop.
    one more way around is I may have to copy the file say to the Temp folder remove spaces then extract the contents and move it back latter. other than that I think I need t maybe dig into the API maybe look at the SDK anyway thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width