spanznet Posted May 12, 2010 Share Posted May 12, 2010 stuck on one last little thing, my .exe will only execute this part of the code if it is run from my c: drive (Win7 x64). Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW) if it is run from any other drive, it just hangs there and does nothing. Is there something better then @WorkingDir?? Link to comment Share on other sites More sharing options...
hawky358 Posted May 12, 2010 Share Posted May 12, 2010 (edited) I assume you mean the folder in which the script is? Use @scriptdir Edited May 12, 2010 by hawky358 Link to comment Share on other sites More sharing options...
spanznet Posted May 12, 2010 Author Share Posted May 12, 2010 I assume you mean the folder in which the script is?Use @scriptdiryes, within the folder my .exe is run is another program (from $SDDBname) that needs to be run. just tried @ScriptDir and it has the same problem, works fine on C: drive but not any other drive (internal or external). Link to comment Share on other sites More sharing options...
hawky358 Posted May 12, 2010 Share Posted May 12, 2010 Maybe post the rest of the code, since both those Macros will work in all drives. Link to comment Share on other sites More sharing options...
spanznet Posted May 12, 2010 Author Share Posted May 12, 2010 this is the whole function: Func downloadSDDB() If $iniArray[8][0] = 1 Then ; If "SD+AV Databases" is ticked $stringSplitArray = StringSplit(($iniArray[8][2]), "/") $SDDBname = $stringSplitArray[$stringSplitArray[0]] Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW) WinWaitActive("Setup - Signature Database Download") Send("{ENTER}") WinWaitActive("Setup - Signature Database Download", "Signature Database Download Complete") Send("{ENTER}") EndIf EndFunc this being my first script, there is probably better ways of doing these things, but it all works great apart from this 'Run' only working on c: drive. I just tested on my housemates PC, also a Win7 x64, and the same problem there, only works on c: drive. thanks for any advice. Link to comment Share on other sites More sharing options...
spanznet Posted May 12, 2010 Author Share Posted May 12, 2010 interesting, I just tried on my netbook in Win7 Starter x86 and WinXP x86 and it WORKED in both when running from an ext hdd. Is this some kind of 64bit problem? Link to comment Share on other sites More sharing options...
water Posted May 12, 2010 Share Posted May 12, 2010 As the command to be run is "calculated" during run time make sure the variable has the desired value. Func downloadSDDB() If $iniArray[8][0] = 1 Then ; If "SD+AV Databases" is ticked $stringSplitArray = StringSplit(($iniArray[8][2]), "/") $SDDBname = $stringSplitArray[$stringSplitArray[0]] MsgBox(0,"","WorkingDir: " & @WorkingDir & @CRLF & "$SDDBName: " & $SDDBName) ; <== Inserted Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW) WinWaitActive("Setup - Signature Database Download") Send("{ENTER}") WinWaitActive("Setup - Signature Database Download", "Signature Database Download Complete") Send("{ENTER}") EndIf EndFunc My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
spanznet Posted May 12, 2010 Author Share Posted May 12, 2010 getting more interesting, i inserted that extra line, the MsgBox clearly displayed exactly what I have been wanting it to do all along, and when i clicked OK... it ran! maybe it just needs a small delay for some reason... Link to comment Share on other sites More sharing options...
spanznet Posted May 12, 2010 Author Share Posted May 12, 2010 Ok, I have managed to get this to run correctly on ext hdd by adding a 2 second sleep in between calculating the filename and executing it. weird, but it works. I increased a few hundred ms at a time and when i got to 2000 it worked straight away. Func downloadSDDB() If $iniArray[8][0] = 1 Then ; If "SD+AV Databases" is ticked $stringSplitArray = StringSplit(($iniArray[8][2]), "/") $SDDBname = $stringSplitArray[$stringSplitArray[0]] Sleep(2000) Run(@WorkingDir & "\" & $SDDBname, @WorkingDir, @SW_SHOW) WinWaitActive("Setup - Signature Database Download") Send("{ENTER}") WinWaitActive("Setup - Signature Database Download", "Signature Database Download Complete") Send("{ENTER}") EndIf EndFunc thanks to water. it was your informational MsgBox line that got me on the track to a solution. 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