How to have a self-extracting Zip file extract to a common folder, like the Desktop

1 users found this article helpful

The Self-Extractor header does not support the use of Environment Variables. In order to cause your self-extractor to place files in a location that can be expressed by using an environment variable, you would need to first extract the files to some set folder that you would designate (such as C:\Target). You would also need to include some sort of script, such as a .bat file, in your Zip file that moves the folder you created to your desired location. This script would then be used as the Command to Issue.

For example, if you would like to have your files extracted to a subfolder named Target whose location would be on the Desktop, you could use something like the following in a .bat file:

MD "%USERPROFILE%\Desktop\Target"
MOVE /Y C:\Target\*.* "%USERPROFILE%\Desktop\Target"

Searching the internet using DOS commands or batch file commands as a search term will provide many sources for more information regarding creating batch files. 

Was this article helpful?

Tell us how we can improve it.