locked
Start-Process to install .exe file RRS feed

  • Question

  • I am trying to install a .exe file and passing id and key as a parameter for installation.

    $activeid = '"{shdgsjd}"'

    $activekey = '"{hdasdbasmdjqww}"'

    $install = Start-Process -Wait -PassThru "file.exe CustId=`"$activeid"` ActiveKey=`"$activekey"`" -ArgumentList '/quiet /norestart /log c:\Desktop\install.log'

    I want to pass the activation id and key during the installation time and the value should be passed with in quotes.

    Installtion works manually with the below line.

    ./file.exe CustId="{shdgsjd}" ActiveKey="{hdasdbasmdjqww}"

    What is the best way to do using script?

    • Edited by asees Sunday, February 24, 2019 2:34 AM
    Thursday, February 21, 2019 11:40 PM

All replies

  • "ArgumentList" is either a string or an array of strings:

    Start-Process $a -ArgumentList "id=$b key=$c /qn /norestart" -Wait -PassThru


    \_(ツ)_/

    Friday, February 22, 2019 2:09 AM
  • Cannot convert <g class="gr_ gr_21 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="21" id="21">value</g> to <g class="gr_ gr_29 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="29" id="29">type</g> system.strings  - error
    Friday, February 22, 2019 4:10 AM
  • Cannot convert <g class="gr_ gr_21 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="21" id="21">value</g> to <g class="gr_ gr_29 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="29" id="29">type</g> system.strings  - error

    Your post is unreadable.


    \_(ツ)_/


    • Edited by jrv Friday, February 22, 2019 4:15 AM
    Friday, February 22, 2019 4:14 AM
  • I am getting the error saying "cannot convert <g class="gr_ gr_29 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="29" id="29">value</g> to <g class="gr_ gr_41 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="41" id="41">type</g> system<g class="gr_ gr_47 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="47" id="47">.strings</g>"

    Friday, February 22, 2019 4:25 AM
  • I am getting the error saying "cannot convert <g class="gr_ gr_29 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="29" id="29">value</g> to <g class="gr_ gr_41 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="41" id="41">type</g> system<g class="gr_ gr_47 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="47" id="47">.strings</g>"

    You post is unreadable.  Turn of Grammarly or upgrade it to the fixed version.


    \_(ツ)_/

    Friday, February 22, 2019 4:31 AM
  • Sorry, i am getting an error saying that "cannot convert value to system.string"
    Friday, February 22, 2019 4:34 AM
  • What code did you run.  The code you posted shows nothing useful.


    \_(ツ)_/

    Friday, February 22, 2019 4:36 AM
  • I am trying to install a .exe file and passing id and key as a parameter for installation.

    $activeid = '"{shdgsjd}"'

    $activekey = '"{hdasdbasmdjqww}"'

    $install = Start-Process -Wait -PassThru "file.exe CustId=`"$activeid"` ActiveKey=`"$activekey"`" -ArgumentList '/quiet /norestart /log c:\Desktop\install.log'

    I want to pass the activation id and key during the installation time and the value should be passed with in quotes.

    Installtion works manually with the below line.

    ./file.exe CustId="{shdgsjd}" ActiveKey="{hdasdbasmdjqww}"

    What is the best way to do using script?

    • Merged by jrv Sunday, February 24, 2019 5:59 AM DUPLICATE
    Sunday, February 24, 2019 4:28 AM
  • Please do not post a new question when you do not get an answer you like.  The people in this forum likely have decades more experience with Windows than you have.  If a suggestion doesn't work then you need to tell us what doesn't work. What are the errors.

    With third party programs you may need o contact the vendor to learn what the vendor requires.

    You have now altered the request.  This may help but you will need to state what the outcome is.

    $activeid = '{shdgsjd}'
    $activekey = '{hdasdbasmdjqww}'
    $arglist = @(
        ('CustId="{0}"' -f $activeid),
        ('ActiveKey="{0}"' -f $activekey),
        '/quiet /norestart /log c:\Desktop\install.log'
    )
    $install = Start-Process file.exe -ArgumentList $arglist

    The command line is tricky and very much depend on what part of Windows is processing the line.  With Start-Process the arguments are not processed by PowerShell but are processed by the system. Understanding how the system processes the arguments will help you determine some of the answer, however, the program being called may do its own processing which is why you may have to contact the vendor.


    \_(ツ)_/

    Sunday, February 24, 2019 6:18 AM
  • Thanks, but it didn't worked the installation just got hunged.
    Sunday, February 24, 2019 11:40 PM
  • You will have to contact the vendor of the exe to help you discover why.

    You should also try removing the double quotes as they should never be necessary when using Start-Process.


    \_(ツ)_/

    Sunday, February 24, 2019 11:45 PM