Creates the SFX archive and set the icon fileĪt your administrative command prompt, type the required information.Adds the command line to run the ps1 file you have typed.$Global:Temp_Conf_file > Temp conf file which will be created to add the commandline.
$Global:Winrar_Folder > Path to your WinRAR folder.$Global:User_Desktop > Path to the current user desktop.$User_Profile > Path to the current user profile.$Temp_Folder > Path to your temp folder.The following variables will also be used: Setup=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -sta -WindowStyle Hidden -noprofile -executionpolicy bypass -file %temp%\MyScript.ps1 Note: Remove the setup part below from the. This file will be stored in the variable $My_Conf_File. conf” file that contains the comment part mentioned above. In this script we will use the same configuration as in the script above: The next script allows you to automate the tasks mentioned earlier: (a) create an SFX archive, (b) apply the comment part to the EXE file and (c) attribute an icon to our EXE file. Automating the EXE creation with PowerShell