PDA

View Full Version : How to GET current working directory?



rtzen1
11-05-2003, 03:36 PM
I'm using the ChangeDirectory() function to set a current working directory prior to executing a batch file via LaunchAppAndWait -- so that relative paths in the batch file will work. No problem there.

However, the documentation for ChangeDirectory() says:


After you call ChangeDirectory to make a specified directory the current directory, that directory cannot be deleted. Before you can delete that directory, you must call ChangeDirectory again to set a different current directory.

So I want to change the current directory when my batch file is done, because it's run before uninstallation which will want to remove the directory I changed to. I'd like to restore the previous current directory, whatever that was. Is there a way to get the current working directory so I can save it in a variable before I call ChangeDirectory() the first time?

Mark at IS
11-05-2003, 03:51 PM
See InstallShield Knowledge Base article Q102334, "HOWTO: Determining the Current Folder," at http://support.installshield.com/kb/aw_results.asp?XSLStyleSheet=%2Fglobal_include%2FAnswerWorks%2Faw-installshield.xsl&update_product=no&PUB=installshield-kb&QS=Q102334.

AndyWhiteley
05-06-2008, 03:23 AM
Hi - I have tried your code exactly as you suggest. The nResult gives a string length which is exactly what i would expect but the variable is empty.

Please can you advise how to get this work in IS 7 Pro as we need this functionality urgently.

Thank you

Andy