Results 1 to 10 of 10
  1. #1
    ||Excision||'s Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    19
    Reputation
    16
    Thanks
    0
    My Mood
    Aggressive

    Issue regarding Pushing arguments to a CMD program (Quick BMS)

    Started fiddling around with QuickBMS's arguments and such. I'm trying to basically use the parameter -o which overwrites any already extracted files in the extraction directory. Now I have no issue doing this straight from windows command prompt to open quick BMS, so I know Quick BMS works perfectly fine when run through the command line. Basically this is what I am trying. Textbox 1 is the input folder or input file to be extracted, textbox 2 is the output location for the extracted files to be extracted to. I have a button that controls those and heres the snippet that I for the life of me cannot get to work. It just opens Quick BMS in GUI mode, or basically types the arguments into its CMD window lolol rendering it useless. For yall to get an idea on how Quick BMS works in command line its like so.
    -o extractionscript.txt Pathtofile pathtooutputextractedfiles.
    Heres the snippet, I really hope to have this thing 100% finished tonight.

    Code:
     Dim processStartInfo = New ProcessStartInfo()
            processStartInfo.FileName = Application.StartupPath & "\qbms.exe"
            processStartInfo.Arguments = "-o """ & Application.StartupPath & "\extract.txt """ & TextBox1.Text.ToString & " " & TextBox2.Text.ToString
            ' processStartInfo.WindowStyle = ProcessWindowStyle.Hidden
            Process.Start(processStartInfo)
    Last edited by ||Excision||; 07-12-2014 at 01:55 PM.

  2. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    -o extractionscript.txt Pathtofile pathtooutputextractedfiles.

    processStartInfo.Arguments = "-o """ & Application.StartupPath & "\extract.txt """ & TextBox1.Text.ToString & " " & TextBox2.Text.ToString
    Maybe the path to "extract.txt" is local, and you don't need to give the full path?
    idk, but you could try it.

    Code:
     Dim processStartInfo = New ProcessStartInfo()
     processStartInfo.FileName = Application.StartupPath & "\qbms.exe"
     Dim commandLineString As String = "-o extract.txt " & TextBox1.Text & " " & TextBox2.Text
     processStartInfo.Arguments = commandLineString
     MsgBox("About to start qbms with params: " & commandLineString)
     Process.Start(processStartInfo)
    I've never heard of quickbms..so I'm just guessing, but seems like you're not passing in the file location like it expects.
    Your other two names start with "PathTo", but not the first param.. just a guess.
    Last edited by abuckau907; 07-12-2014 at 04:06 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  3. The Following User Says Thank You to abuckau907 For This Useful Post:

    ||Excision|| (07-13-2014)

  4. #3
    ||Excision||'s Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    19
    Reputation
    16
    Thanks
    0
    My Mood
    Aggressive
    Quote Originally Posted by abuckau907 View Post
    Maybe the path to "extract.txt" is local, and you don't need to give the full path?
    idk, but you could try it.

    Code:
     Dim processStartInfo = New ProcessStartInfo()
     processStartInfo.FileName = Application.StartupPath & "\qbms.exe"
     Dim commandLineString As String = "-o extract.txt " & TextBox1.Text & " " & TextBox2.Text
     processStartInfo.Arguments = commandLineString
     MsgBox("About to start qbms with params: " & commandLineString)
     Process.Start(processStartInfo)
    I've never heard of quickbms..so I'm just guessing, but seems like you're not passing in the file location like it expects.
    Your other two names start with "PathTo", but not the first param.. just a guess.
    It works like this

    Code:
     Dim processStartInfo = New ProcessStartInfo()
            processStartInfo.FileName = Application.StartupPath & "\qbms.exe"
            Dim commandLineString As String = "-o extract.txt " & "levels.pak" & " " & "\new"
            processStartInfo.Arguments = commandLineString
            MsgBox("About to start qbms with params: " & commandLineString)
            Process.Start(processStartInfo)
    But if I try to use Textbox1.Text and Textbox2.text it doesnt work. O_o I think it has something to do with the spaces in the directory. Or the length of the input and/or output paths. Any way around this?

  5. #4
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    "But if I try to use Textbox1.Text and Textbox2.text it doesnt work. O_o"

    O_o is exactly right. That doesn't make sense..it's basic string concatination..

    Please take 2 screenshots : one for each messagebox().

    Code:
    Dim processStartInfo = New ProcessStartInfo()
    processStartInfo.FileName = Application.StartupPath & "\qbms.exe"
    Dim commandLineString As String = "-o extract.txt " & TextBox1.Text & " " & TextBox2.Text
    processStartInfo.Arguments = commandLineString
    MsgBox("About to start qbms with params: " & commandLineString)
    Process.Start(processStartInfo)
    Code:
    Dim processStartInfo = New ProcessStartInfo()
    processStartInfo.FileName = Application.StartupPath & "\qbms.exe"
    Dim commandLineString As String = "-o extract.txt levels.pak \new"
    processStartInfo.Arguments = commandLineString
    MsgBox("About to start qbms with params: " & commandLineString)
    Process.Start(processStartInfo)
    we should see the same string : / (assuming you set the TextBox1.Text and TextBox2.Text to "levels.pak" and "\new")

     

    My favorite site is tinypic dot com , but you can use any other free public hosting site.
    (tinypic is nice because if gives you the link in bbc format described below)

    To include the picture right in your post use [ img ] [ /img ]


    [ IMG ] w w w dot image_url dot com / image . jpg [ /IMG ]

    remove spaces inside the [ ] tags.

    Last edited by abuckau907; 07-13-2014 at 01:54 AM. Reason: spacing
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  6. #5
    ||Excision||'s Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    19
    Reputation
    16
    Thanks
    0
    My Mood
    Aggressive
    Ok, It's all good now. I had a quote randomly placed lol. I must have tapped it with my pinkie xD But now the problem lies in the open file dialogue. One button opens the file dialog and after selecting the PAK file, it passes the full file path of it to Textbbox1.Text, and then I push the select output button and another open file dialog opens and it passes that full path too Textbox2.text. I cannot remember for the life of me how to remove the C:\blah blahfilename\Foldername\junk folder\ from both file paths and only display the PAK file name for textbox1.text and the folder name for textbox2.text.

    abuckau907 dont fail me now lol. Seriously though thanks for the help so far

  7. #6
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Basic string manipulation..come on..

    Code:
            Dim str1 As String = "C:\users\Buckau\Desktop\aaa\bbb\file.ext"
    
            Dim lastIndx As Int32 = str1.LastIndexOf("\"c)
            Dim stringEnd As String = str1.Substring(lastIndx + 1)
            MsgBox(stringEnd)
    or a million other ways to do it.
    Last edited by abuckau907; 07-13-2014 at 03:34 AM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  8. The Following User Says Thank You to abuckau907 For This Useful Post:

    ||Excision|| (07-13-2014)

  9. #7
    ||Excision||'s Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    19
    Reputation
    16
    Thanks
    0
    My Mood
    Aggressive
    I ended up just having it open a file in the application start-up path and extract to a new folder in the same path. Easier this way for Quick BMS to stop being so fiddly with spaces in file paths. Quick question lol. How would I go about opening a win.BMD file in Visual basics and then being able to edit the file and save it? I have been trying to figure out how to do that part for ages lol

  10. #8
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Same way you'd modify any other type of file? Idk man, too much help for someone who doesn't know how to program.
    (and I have no idea what .bmd is for)

    "Easier this way for Quick BMS to stop being so fiddly with spaces in file paths."
    It probably expects double-quotes around the file-path if it's not simply a local filename. Apparently you know how to use the weird """ thing for vb, if you don't want users to have to make it all local..it'd be worth testing. Whatever works for you.


    Write some code and come back to the forum when you have a good question (not "how do I _____"!). I'm not going to tutor you like this..
    Last edited by abuckau907; 07-13-2014 at 03:50 AM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  11. #9
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,993
    Reputation
    374
    Thanks
    8,808
    My Mood
    Twisted
    Quote Originally Posted by abuckau907 View Post
    or a million other ways to do it.
    Code:
    string filename = Path.GetFileName(filepath);

  12. The Following User Says Thank You to Biesi For This Useful Post:

    ||Excision|| (07-13-2014)

  13. #10
    ||Excision||'s Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    19
    Reputation
    16
    Thanks
    0
    My Mood
    Aggressive
    I know how to program a decent bit. I just have not done anything programming related in about 5 or so years haha. But I now have everything working perfectly. and yes I know about the double quotes lol. For some reason Quick BMS did not want to take the arguments in that format. So I had to jury rig it a bit. Works great Now for the .BMD editing algorithms Thanks abuckau907! And also you Biesi :3

Similar Threads

  1. Sound doesn't work in most programs / Computer Issues
    By Blitz in forum Suggestions, Requests & General Help
    Replies: 2
    Last Post: 01-03-2012, 04:55 AM
  2. Issues concerning a certain program
    By 258456 in forum CrossFire Discussions
    Replies: 2
    Last Post: 03-20-2011, 07:25 PM
  3. Issue regarding sub forums
    By arunforce in forum News & Announcements
    Replies: 0
    Last Post: 11-10-2007, 10:09 AM