View Full Version : Application copy itself into other location
mangomel
11-21-2006, 11:55 AM
I built my app as email attachement - single, compressed file.
And I want it would be able copy itself in other location.
So I have to get actual location of my app and then use File.Copy action.
But how to get actual location?
TristanD
11-22-2006, 05:52 AM
try inserting _SourceFolder as the path of the 'to be copyied' file so it looks like this
File.Copy(_SourceFolder "myfilename.exe", *.exe", _DesktopFolder .. "", false);
didnt test but should work
mangomel
11-22-2006, 02:46 PM
I tried it before. Not work.
_Sourcefolder is a folder where from autoplay.exe was executed.
But this single-file application decompress its content to 'temp' folder (most often in Drive:\Documents and settings\user\application data\temp) and from there it execute 'autoplay.exe'. So _Sourcefolder don't cointains that single app but the decompressed files.
I thought about System.EnumerateProcesses action but I don't know how to get file path from any process.
Dermot
11-22-2006, 02:53 PM
A simple search finds this
http://www.indigorose.com/forums/showthread.php?t=16724&highlight=exe+folder
The third post shows you a simple solution to find the path to the folder where the exex was run from.
TristanD
11-22-2006, 03:14 PM
i know the Dynamic link to the tempfolder as well that is _TempFolder (As obvious as it may seem) how its of some good use to you;)
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.