Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008
    Posts
    82

    Command prompt switches on File.Run

    Hi Friends,

    The command i want to send to the command prompt in File.Run action is
    /q:a /c:"install /q"
    Note that this has a string inside the set of the command switches

    I have done the following to run the exe and i want the above command prompt switches to be given for the exe to run

    retStat=File.Run("", SessionVar.Expand("%TEMPexe%").."\\dotnetfx.exe", "/q:a /c:\"install /q\"", SW_MINIMIZE, true);
    can anyone help on this. The above syntax gives me errors prompting for wrong switches.

    ThankYou in advance
    Last edited by kk250040; 01-22-2009 at 06:46 AM. Reason: wanted to quote the script

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    This is well covered in the help file; as well as several posts in the forums....

    You need to "escape" the quote


    c = "My name is \"Josh\"";

    this results in a variable 'c' that contains
    Code:
    My Name is "Josh"


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  3. #3
    Join Date
    Feb 2008
    Posts
    82

    same thing

    Hi Jassing,

    I did the same... I used the escape-sequence \" for inserting those switches into the arguments.
    I tried two syntax for that to be done.

    One being
    retStat=File.Run("", SessionVar.Expand("%TEMPexe%").."\\dotnetfx.exe", "/q:a /c:\"install /q\"", SW_MINIMIZE, true);
    and the other being
    retStat=File.Run("", SessionVar.Expand("%TEMPexe%").."\\dotnetfx.exe", "/q:a /c:".."\"".."install /q".."\"".."", SW_MINIMIZE, true);
    Please correct me if you find anything wrong, the exe runs correctly when i use the command switches at the command prompt, but somehow the switches prompt to be wrong when i use them from the sf7 scripts, can u tell me wat i can do for this. I am done with the task through a batch file though, but any comments how i can do this thru sf7 scripts?

    ThankYou in advance
    Last edited by kk250040; 01-22-2009 at 09:38 AM. Reason: corrected it

  4. #4
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    I am a bit “out-dated”, but I think you should check your File.Run syntax. It seems you are passing your arguments as the WorkingFolder string. If you are unsure about the result of your string, I recommend to temporarily using a dialog message box or the SetupData.WriteToLogFile action:

    Code:
    sArgs = "/q:a /c:\"install /q\""
    Dialog.Message("Notice 1", sFile.." - "..sArgs, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Another tip: To make the code line more readable, you may use a combination of single and double quotes:

    Code:
    sArgs = '/q:a /c:"install /q"'

Similar Threads

  1. AMS Irc client?
    By ShadowUK in forum AutoPlay Media Studio 7.5
    Replies: 13
    Last Post: 07-19-2010, 09:14 AM
  2. Problem with passing a string variable to DLL
    By kenansoy in forum MSI Factory 2.0 Discussion
    Replies: 2
    Last Post: 12-03-2007, 09:08 AM
  3. Jukebox Enhancements
    By Zylo in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 01-13-2007, 07:39 PM
  4. Passing a Table as argument in a function
    By Davide It in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 11-30-2006, 01:14 AM

Posting Permissions

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