mazin Posted March 16, 2004 Share Posted March 16, 2004 Sometimes we execute a command for copying files and find that nothing was copied.Also, we may have messages like these in case we use the PAUSE command:- The syntax of the command is incorrect- Access is denied. 0 file(s) copied.- Bad command or file nameIn case we don't use the PAUSE command, we won't get messages and won't get files copied over.Even if we use the "copy /y", copying might fail.Mostly, files we wanted to replace were system files, read-only files, or protected ".exe" files.Or, we might type paths or file names mistakenly.Whatever the cause is, I use WinRAR to make a silent SFX that forces files to be copied, either files replace others or don't.Example 1-------------Packing for extractionSuppose we want to copy a folder named "incoming" that contains files or folders or both. These are the steps:1- Right-click the folder "incoming", wherever it is.2- From the WinRAR shortcut menu, click Add to "incoming.rar".3- Right-click the resulting archive "incoming.rar", and choose "Open". It should open in WinRAR.4- Hit Alt+x on your keyboard. The SFX tab appears. Press the button "Advanced SFX options".5- Under the "General" tab, in the field "the Path to extract", type this:%systemdrive%\Program Files\Common Files\Symantec Shared\VirusDefs\Don't add any quotation marks.Here, we assume that the folder "incoming" needs to be pasted inside the folder "VirusDefs". So, the back slash "\" is a must!6- Still under the "General" tab, choose "Create in the current folder".So that the resulting SFX "incoming.exe" is put inside the folder where you work now.7- Under the "Modes" tab, choose "Hide all" as a silent mode, "Overwrite all files" as an overwrite mode. Press "OK" for the "Advanced SFX options" dialogue box to close.8- Press "OK" for the other dialogue box to close. Close WinRAR.Now, you should have a self-extracting archive of name "incoming.exe" with a familiar icon of a box with three books!9- Delete the folder "incoming" and the archive "incoming.rar" as they are no longer needed.Now, if you run "incoming.exe", either directly or from a batch, it should execute silently without any switches, even if it replaces another folder of the same name and with the same contents.Other persons may have different methods. If so, please contribute. Link to comment Share on other sites More sharing options...
mazin Posted May 17, 2004 Author Share Posted May 17, 2004 Example 2--------------------Packing for installationI assume you want to pack the two files needed for installing Adobe Reader 6.0, which are cab + msi.1- Open WinRAR. Go to: File --> Browse for folder. Browse to the folder in which you stored the two files.2- Highlight the two files. Go to: Commands --> Add files to archive, The "Archive name and parameters" dialog box appears.On the "General" tab, press the button "Profiles..." and choose "Default Profile".Still On the "General" tab, in the field "Archive name", type a name for the new compressed file like AR6.exe, and don't forget the extension ".exe"Then, choose these parameters:- Archive format: RAR- Compression method: Best- Archiving options: Create SFX archiveYou don't need to play with other parameters.3- Go to "Advanced" tab, Press the button "SFX options". The "Advanced SFX Options" dialog box appears.On the "General" tab, choose "Create in the current folder".In the field "Run after extraction", type the name of your installer, this should be the name of your msi. Don't forget the extension ".msi". If you need to put switches, put them after .msi, as you usually do in a batch line.4- Go to "Modes" tab, choose: Unpack to temporary folder + Hide all + Overwrite all files.5- Press "OK' on all dialogs and wait for the compression process to complete. Close WinRAR.You should find "AR6.exe" inside the folder you browsed to in step 1.You need to add this line to your batch file:start /wait %systemdrive%\Install\AR6\AR6.exeNo switches are needed, as you can see. Link to comment Share on other sites More sharing options...
edmoncu Posted May 18, 2004 Share Posted May 18, 2004 wow, cool tips! i was wondering, if ever i am to decide to password protect the SFX archive, would it be possible to include a commandline parameter when decompressing it from a batch file (or an automation tool like AutoIt)? thanks! Link to comment Share on other sites More sharing options...
mazin Posted May 18, 2004 Author Share Posted May 18, 2004 When it comes to password-protected SFX, WinRAR is easy. This option is found here:"Archive name and parameters" dialog box --> Advanced --> Set password...A password longer than 8 characters is much more secure.When extracting, the password must be entered. This can be done using a VBS, a JScript, or AutoIt, depending on which one you are familiar with. Link to comment Share on other sites More sharing options...
captdilly Posted July 4, 2004 Share Posted July 4, 2004 What is the point in passwording the SFX if you automatically enter the password? Link to comment Share on other sites More sharing options...
mazin Posted July 4, 2004 Author Share Posted July 4, 2004 I think edmoncu meant to prevent others from using his SFX. Link to comment Share on other sites More sharing options...
ViperSpeeder Posted October 12, 2004 Share Posted October 12, 2004 One quick question, If this is being used in RunOnceEx will RunOnceEx continue after the SFX is extracted or will it wait until the entire operation is complete (running the Msi file and switches within the archive)? Thanks for any help. Link to comment Share on other sites More sharing options...
Adiel Posted October 12, 2004 Share Posted October 12, 2004 well i'm having some problems with XCOPY , i'll try this examples , thank you mazin! Link to comment Share on other sites More sharing options...
mazin Posted October 12, 2004 Author Share Posted October 12, 2004 @ViperSpeederPersonally, I haven't faced such a problem. But I recall I read something like that posted by others.If you face such a problem or want to make precautions, follow the following example.That is, let RunOnceEX extract the archive without switches. Then, run your executable or MSI via a separate command line.EXAMPLE:REG ADD .......\MySFX.exe (without switches being put inside the SFX)REG ADD .......\ThePathOnMyHardDisk\To\ExtractedMSI\My.msi /qb (or whatever switch)@AdielI don't use XCOPY, myself. Link to comment Share on other sites More sharing options...
ViperSpeeder Posted October 12, 2004 Share Posted October 12, 2004 Ok, Thanks for the info mazin. Link to comment Share on other sites More sharing options...
a06lp Posted October 18, 2004 Share Posted October 18, 2004 is there a list somewhere of the SFX codes?Im very insterested in the "Shortcut" command, but I don't understand how it works... Link to comment Share on other sites More sharing options...
MichaelMagdy Posted December 26, 2005 Share Posted December 26, 2005 thank's mazini'm new in all of this but i learn so quick Link to comment Share on other sites More sharing options...
LeveL Posted December 26, 2005 Share Posted December 26, 2005 (edited) You can put any standalone apps in a folder calledAPPS and any shortcuts inside folders named for that appand put THOSE fiolders all into a folder called SCThen the below script can be run, just put APPSand SC folders in the same folder as the script.This way you have no scripting to do! Just make sureyour shortcut (for start menu) goes into its own folderlike Adobe, Cyberlink, Acme, or whatever and THATgoes into the SC folder, then APPS has a folder, say"Aida32" and in there is the EXE the shortcut relates to,its a bit of a pain because you have to make the shortcutinitially by having the app in your own program files to beginwith, but that shortcut, once created, can be placed intothe distribution folder.Script...XCOPY APPS "%PROGRAMFILES%" /i /s /e /r /v /k /f /c /h /yXCOPY SC "%ALLUSERSPROFILE%\Start Menu\Programs" /i /s /e /r /v /k /f /c /h /yTwo simple lines of code! This is a foolproof method for AFTER Windows has installedin case, like you said, some files in $Progs and $Docs do notcopy over **** Microsoft.Here are a lot of progs that are standalone...Aida32CPU-ZCWS ShredderDisk SpeedDLL ViewereMuleHijackThisMedia Player ClassicuTorrentRegmon (any sysinternals progs you care to add in fact!)RAM TesterSpace MongerTCP ViewVirtualDubAll of which do not touch your registry!Just copy over to use!! Edited December 26, 2005 by LeveL Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now