PDA

View Full Version : cd .. change directory possible?


WallyWonka
06-20-2009, 09:49 AM
I have this project I want to use as a launcher for a program. The project will launch files in a directory previous of the project directory. How would I launch these files using this example as I would use it in a batch file. (I don't want to create dozens and dozens of batch files).

cd..
myapp.exe
cd AppFolder

Not sure if there is a way to do this, but maybe I am missing something. Thanks to anyone who can help.

MicroByte
06-20-2009, 10:24 AM
look at the help file at "Folder.SetCurrent" :yes

WallyWonka
06-20-2009, 10:47 AM
I played around with that Action, but that would work if the files to be launched were in a upper subfolder. I have to get a folder that is outside the project, the folder that is BEFORE the source folder. For instance my project would be this.

C:\MyApp\AMS Project\AutoPlay.exe

C:\MyApp\myapp.exe

How would I set the current folder to C:\MyApp so I can launch myapp.exe?

longedge
06-20-2009, 12:06 PM
If you are building your project to a "Web/Email Executable" then this line of code -


drv = String.SplitPath(String.Replace(_CommandLineArgs[1], "SFXSOURCE:", "", true)).Drive;

will give you the drive e.g. " C:" and you can build the rest of the path from there since you presumably know what it is.

Note this will only work if it's an exe. If you build to a normal folder structure, then the code -

drv = _SourceDrive

will give you the drive letter.