Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Posts
    1

    Star Variables handling

    Start waving to the components of the forum in my first post and to clarify that English is not my native language.

    The final aim is to let the user to be able to select several simple parameters from a double command, combine these variables of the command to the selected disk drive. I have read a lot, but I’m confused in my beginnings.

    This example is without the use of these variables, that I want to select from input, listbox, combobox, etc. In blue chkdsk command example, in red the selection of the drive.

    File.Run("C:\\WINDOWS\\SYSTEM32\\CMD.EXE", "/C chkdsk /I/C F: >exit.txt" , "C:\\TEMP", SW_SHOWNORMAL, true);
    File.Open("C:\\TEMP\\exit.txt", "", SW_SHOWNORMAL);

    Told me I look good, thanks.

  2. #2
    Join Date
    Apr 2006
    Posts
    127
    The values are assigned to variables according to what the User picks via a ListBox, ComboBox etc. Sounds as though you understand how to do that.

    The arguments for the exe to be run are passed as a string to the File.Run function, so you can simply concatenate your var values to make that string. For example:

    The vars collected:

    Var1 = "/C chkdsk";
    Var2 = "/I";
    Var3 = "/C";
    Var4 = "F:";

    Concatenate these into a string Var called 'Args':

    Args = Var1 .. Var2 .. Var3 .. " " .. Var4 .. " >exit.txt";

    So now the File.Run function looks like this:

    File.Run("C:\\WINDOWS\\SYSTEM32\\CMD.EXE", Args, "C:\\TEMP", SW_SHOWNORMAL, true);

Posting Permissions

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