-1

I am extracting a WinRar file silently using power shell but a popup comes up asking Yes or Yes to All or No or No to All.

How to do it completely silent and if it is possible to extract in another folder ? I have run below command.

Start-Process 'directory\jre-6u37-windows-i586.exe' -ArgumentList "/s" -Wait

For example, if I have a SFX Archived file in temp folder and when I run the powershell command below I get attached popup for confirmation. How can I make the command complete silently?

Start-Process 'C:\temp\test' -ArgumentList "/s" -Wait

The following dialog pops up:

enter image description here

zdan
  • 28,667
  • 7
  • 60
  • 71
Majeed
  • 77
  • 7
  • How can I pass 1 more Argument in this command for Yes to All – Majeed Feb 17 '18 at 05:13
  • The code in your question is for Java Runtime not WinRar? But you can pass multiple argument like this example: `-ArgumentList "/s","/a","/b","/c"` – henrycarteruk Feb 17 '18 at 07:20
  • Nope it does not work for me, it is still asking for confirmation with these opens Yes, Yes To All or No No to All. – Majeed Feb 18 '18 at 13:07
  • Is there any switch which can suppress these confirmation window and do it silently. Or I guess I am getting this popup as all the files are being extracted in the same folder that is why the popup comes is there a way to extract in another folder ? – Majeed Feb 18 '18 at 13:09
  • My **example** wasn't an answer, just showing how you would send multiple arguments. We don't know what you are currently trying to do because you current code shows you're trying to run Java JRE and not WinRar! (as I said before) – henrycarteruk Feb 18 '18 at 15:42
  • WinRAR SFX executables do not support command line options. You have to create the SFX archive with the SFX options __Hide all__ and __Overwrite all files__. Start __WinRAR__, select a directory or file, click in toolbar on __Add__, enable option __Create SFX archive__, switch to tab __Advanced__, click on button __SFX options__, view each tab of __Advanced SFX options__ and use button __Help__ on each tab to read about those options. – Mofi Feb 20 '18 at 06:36

1 Answers1

0

Without a screenshot of the particular pop up, my guess is the popup you are referring to is the one from PowerShell and not from the process you are starting.

If that's the case its probably tripping your $confirmpreference setting.

You can try either setting $confirmpreference to "none" or you can try adding the parameter -confirm:$false to your cmdlet.

Sambardo
  • 714
  • 2
  • 9
  • 15