Results 1 to 8 of 8

Thread: [2008] Problems launching mkisofs.exe with parameters

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2007
    Posts
    159

    [2008] Problems launching mkisofs.exe with parameters

    I'm trying to incorporate an ISO creation function within my app. It's purely for creating dvd-video compliant ISO images.

    I'm using the open source mkisofs.exe (with cygwin1.dll). The full command should be:-

    mkisofs.exe -dvd-video -o <isoimagename.iso> <directory with video files>

    e.g.

    mkisofs.exe -dvd-video -o "c:\isoimages\test.iso" "c:\dvd files\my movie"

    I've tried various ways of calling this, but each time I do, a command prompt windows appears and in a split second disappears again, and I don't know why!

    ALSO, while on the subject, if I can get that bit working, then mkisofs.exe outputs a percentage complete as it goes through the process - I'd like to redirect that output back to my application so that I can incorporate a progress bar....

    Can anyone help?
    If my post helped you, please rate it. Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Problems launching mkisofs.exe with parameters

    You use Process.Start to start a new process. Read the documentation and it will tell you how to pass arguments on the commandline of the EXE you run.

    There's a submission in the VB.NET CodeBank forum on redirecting command prompt output that will sort out your last question.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2007
    Posts
    159

    Re: [2008] Problems launching mkisofs.exe with parameters

    Well, I am getting no closer. This is the code I have. The CMD window opens and nothing happens after that...

    vb.net Code:
    1. Private Results As String
    2.     Private Delegate Sub delUpdate()
    3.     Private Finished As New delUpdate(AddressOf UpdateText)
    4.  
    5.     Private Sub UpdateText()
    6.         txtResults.Text = Results
    7.     End Sub
    8.  
    9.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    10.         Dim CMDThread As New Threading.Thread(AddressOf CMDAutomate)
    11.         CMDThread.Start()
    12.     End Sub
    13.  
    14.  
    15.     Private Sub CMDAutomate()
    16.         Dim myprocess As New Process
    17.         Dim StartInfo As New System.Diagnostics.ProcessStartInfo
    18.         StartInfo.FileName = "cmd" 'starts cmd window    
    19.         StartInfo.RedirectStandardInput = True
    20.         StartInfo.RedirectStandardOutput = True
    21.         StartInfo.UseShellExecute = False 'required to redirect        
    22.         StartInfo.CreateNoWindow = False 'True 'creates no cmd window        
    23.         myprocess.StartInfo = StartInfo
    24.         myprocess.Start()
    25.         Dim SR As System.IO.StreamReader = myprocess.StandardOutput
    26.         Dim SW As System.IO.StreamWriter = myprocess.StandardInput
    27.         SW.WriteLine(Convert.ToChar(34) & System.Windows.Forms.Application.StartupPath & "\mkisofs.exe" & Convert.ToChar(34) & " -dvd-video -o " & Convert.ToChar(34) & "S:\Converted DVDs\test.iso" & Convert.ToChar(34) & " " & Convert.ToChar(34) & "S:\Converted DVDs\crystal-wwcs" & Convert.ToChar(34)) 'the command you wish to run.....        
    28.         SW.WriteLine("exit") 'exits command prompt window        
    29.         Results = SR.ReadToEnd 'returns results of the command window        
    30.         SW.Close()
    31.         SR.Close()
    32.         'invokes Finished delegate, which updates textbox with the results text        
    33.         Invoke(Finished)
    34.     End Sub

    For info, I have uploaded mkisofs.exe with cygwin1.dll to http://www.cgeuk.com/mkisofs.zip
    If my post helped you, please rate it. Thanks.

  4. #4
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: [2008] Problems launching mkisofs.exe with parameters

    have you tried
    Code:
    Process.start("mkisofs.exe", "-dvd-video -o ""c:\isoimages\test.iso"" ""c:\dvd files\my movie"" ")
    __________________
    Rate the posts that helped you

  5. #5
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: [2008] Problems launching mkisofs.exe with parameters

    as far as your code is concer you are only calling cmd in your process..


    Code:
     StartInfo.FileName = "cmd" 
    .....
    
    myprocess.Start()
    __________________
    Rate the posts that helped you

  6. #6
    New Member
    Join Date
    Jul 2008
    Posts
    1

    Re: [2008] Problems launching mkisofs.exe with parameters

    I'm just kicking off a batch file and passing parameters, but had the same issue, the DOS box would flash, then go away. This didn't occur all the time so I knew the batch was good. The problem was having spaces in the path.
    Your path " "c:\dvd files\my movie"" has a space between "my" and "movie". Remove the space and try again.
    Good luck

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2007
    Posts
    159

    Re: [2008] Problems launching mkisofs.exe with parameters

    Quote Originally Posted by McDuff
    I'm just kicking off a batch file and passing parameters, but had the same issue, the DOS box would flash, then go away. This didn't occur all the time so I knew the batch was good. The problem was having spaces in the path.
    Your path " "c:\dvd files\my movie"" has a space between "my" and "movie". Remove the space and try again.
    Good luck
    I had already taken the spaces out - for example I changed "Converted DVDs" to "conver~1" and that made no difference...
    If my post helped you, please rate it. Thanks.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Nov 2007
    Posts
    159

    Re: [2008] Problems launching mkisofs.exe with parameters

    Quote Originally Posted by riteshjain1982
    have you tried
    Code:
    Process.start("mkisofs.exe", "-dvd-video -o ""c:\isoimages\test.iso"" ""c:\dvd files\my movie"" ")
    Yes - and it doesn't work I'm afraid....

    Quote Originally Posted by riteshjain1982
    as far as your code is concer you are only calling cmd in your process..


    Code:
     StartInfo.FileName = "cmd" 
    .....
    
    myprocess.Start()
    Yes - but the SW.WriteLine is supposed to send the mkisofs.exe command, and when finished, the exit command - and the output of the cmd window is to be returned back to my app...
    If my post helped you, please rate it. Thanks.

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