ppat Posted March 26, 2009 Share Posted March 26, 2009 My prog.au3 file is on a crypted container. I mount the container to drive F:\, using TrueCrypt or equivalent crytology software. I can run the program prog.au3 without problem. But for some reason I can't explain in detail here, the program has to force a dismount of the container on which it is located.To my surprise, the program continues to sort of work, even when F:\ does not exist anymore. But some functions do not seem to work properly.So could someone explain how launching an au3 file works? Does it load all the includes and the program into memory at the start of the launch? Are all includes really loaded to memory? I understand that forcing a dismount of the drive from which the au3 file is running is not very good practice, but once again, I have no choice. I would like to understand how things work.My code for F:\prog.au3 looks like that:; Note: the crypted drive must be mounted to F:\ to launch this program #include "C:\script_on_C.au3" #include "F:\other_script_on_mounted_drive.au3" ; Do some stuff RunWait("""" & "C:\Program Files\TrueCrypt\TrueCrypt.exe" & """ " & "/quit /force /dismount F") ; Do other stuff such as calling functions from [b]C:\script_on_C.au3[/b] and [b]F:\other_script_on_mounted_drive.au3[/b] ; A bit dangerous as the F:\ drive does not exist any more ; Kind of half works (some things get executed, others not) Link to comment Share on other sites More sharing options...
ppat Posted March 27, 2009 Author Share Posted March 27, 2009 OK, not much help sofar, I will give some code easier to reproduce. Here is what you need to do:Install Truecrypt software on your PCCreate a crypted volume ("Create Volume" button). For example a 1MB volume. Mount the volume to L:\ Create a L:\test.au3 file Add the autoit code to itRunWait(Chr(34) & "C:\Program Files\TrueCrypt\TrueCrypt.exe" & Chr(34) & " /dismount L /force /quit background") MsgBox(0,"Note", "L has been dismounted") RunWait("C:\WINNT\system32\notepad.exe") MsgBox(0,"End of Test", "Check if the Notepad has been launched. Does not launch for user:ppat.")Now the strange thing is that after dismounting the L drive, all RunWait instructions seem to be ignored (or to fail?). But the last MsgBox execution is done successfully.So could someone explain why the program seems to be executed till its end, even after L has been dismounted, but RunWait instructions fail after the dismount? Link to comment Share on other sites More sharing options...
jvanegmond Posted March 27, 2009 Share Posted March 27, 2009 To my surprise, the program continues to sort of work, even when F:\ does not exist anymore. But some functions do not seem to work properly.Same here. I think it is impressive AutoIt is still running even after something that Windows should not allow to be done in the first place (unmounting a drive that is in use).I think we should leave it at that too. Don't try to add functionality and support for something is completely wrong to do. github.com/jvanegmond Link to comment Share on other sites More sharing options...
ppat Posted March 31, 2009 Author Share Posted March 31, 2009 I think we should leave it at that too. Don't try to add functionality and support for something is completely wrong to do.You are right. I completely revised my code so that it resides on drive C:\ Only a tiny bit of the code with the passwords sits on the encrypted drive, and I call it in a parallel call to autoit.exe.By doing so, mounting / dismounting the encrypted drive, as well as the functions after the dismount command work as expected now. Link to comment Share on other sites More sharing options...
WideBoyDixon Posted March 31, 2009 Share Posted March 31, 2009 This might be interesting to you:http://www.pocketappreview.com/main/item/ejectusbWBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] 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