azkerm Posted September 20, 2019 Posted September 20, 2019 Hi There, I use below scripts for Dropbox with Truecrypt and I have now modified it to be used with Google drive, but it neither loads nor quits the googledrive app. Below is what I use; So the concept is, the script opens the truecrypt container and mounts it to drive letter "S", then opens the googledrive so that the mounted drive can start synchronizing with googledrive. Upon un-mounting, it will kill the active process of googledrive, then un-mount the trucrypt container. This is the MountTC.au3 file #AutoIt3Wrapper_icon=lock.ico #include"_TC.au3" _TC_Path("C:\Program Files\TrueCrypt\TrueCrypt.exe") $result=True if DriveStatus("S:\")<> "INVALID" Then ;Check if we're already mounted $result=True else $result =_TC_Mount("D:\SecureDrive\AzkySecure.tc","S") EndIf If $result = True Then $PID = ProcessExists("googledrivesync.exe") ; Will return the PID or 0 if the process isn't found. If not $PID Then $result= Run ("C:\Program Files\Google\Drive\") if not $result then MsgBox(0,"Error", "Could not load GoogleDrive",5) EndIf ;Restart indexing service so we pick up the TrueCrypt partition $result = RunWait(@ComSpec & " /c " & 'sc stop wsearch', "", @SW_HIDE) Sleep(3000) $result = RunWait(@ComSpec & " /c " & 'sc start wsearch"', "", @SW_HIDE) ;$result = Run(@ComSpec & " /c " & "C:\users\user1\Documents\Scripts\Restart Windows Search Indexing Task.lnk") Else MsgBox(0,"Mount Cancelled","Secure Partition has not been mounted.",1) EndIf This is the UmountTC.au3 file #include"_TC.au3" _TC_Path("C:\Program Files\TrueCrypt\TrueCrypt.exe") ;$result =_TC_Mount("c:\Users\Suhail\Documents\datavault.tc","S") ;If $result = True Then ; $result= Run ("C:\Users\Suhail\AppData\Roaming\Dropbox\bin\Dropbox") ; if not $result then MsgBox(0,"Dropbox Error", "Could not load Dropbox") ;EndIf $result=True $PID = ProcessExists("googledrivesync.exe") ; Will return the PID or 0 if the process isn't found. If $PID Then $result=ProcessClose($PID) If not $result Then MsgBox(0,"Unmount Aborted","Could not shutdown Dropbox") Else ;Stop the indexing service as we use this primarily for items on secure drive $result = RunWait(@ComSpec & " /c " & 'sc stop wsearch', "", @SW_HIDE) if DriveStatus("S:\")<> "INVALID" Then $result =_TC_UnMount("S",1) if not $result then MsgBox(0,"Error Unmounting","An error occured unmounting the secure drive") Else MsgBox(0,"Secure Partition Not Found","It appears as if the secure partition is not mounted",2) EndIf EndIf Any idea what could be wrong?
Earthshine Posted September 20, 2019 Posted September 20, 2019 i would use a while loop for the processexists calls and actually wait for it My resources are limited. You must ask the right questions
azkerm Posted September 20, 2019 Author Posted September 20, 2019 Would you mind helping on this? I'm not best in programming or languages..
Earthshine Posted September 20, 2019 Posted September 20, 2019 When I get back into the office I’ll give it a crack My resources are limited. You must ask the right questions
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