Champak Posted January 4, 2016 Share Posted January 4, 2016 (edited) I don't know how to exactly phrase this question but I'll try my best.I have a folder named Folder 1, which contains two folders named AA and BB. My app was originally in Folder 1 calling a file in Folder AA. So the call was, @scriptdir\Folder AA. I now moved the app to Folder BB, but it still needs to call the file in Folder AA. How do I easily call for this file now without hard coding an entire file path? Thanks. Edited January 4, 2016 by Champak Link to comment Share on other sites More sharing options...
Gianni Posted January 5, 2016 Share Posted January 5, 2016 (edited) from within Folder BB use relative path like this "..\Folder AA\file" Edited January 5, 2016 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Champak Posted January 5, 2016 Author Share Posted January 5, 2016 Thanks, it worked...somewhat. When I put the path as that, I get an error. It's to an avi file (or at least that one is the one I've noticed the problem with so far). The error shows the file and path is correct (it's compiled) stating (paraphrasing) that the avi is unable to play due to it being corrupted or something and I should try renstalling it. When I change the path to a full path it works. I tried requireAdmin and still have the same issue. When I get home later I'll put the exact error msg, but any ideas? Link to comment Share on other sites More sharing options...
Champak Posted January 6, 2016 Author Share Posted January 6, 2016 This is the message I'm getting:Title-----Bad Image(full file path) is either not designed to run on Windows or it contains an error. Try installing the the program again using the original installation media or contact your system administrator r the software vendor for support. Error status 0xc000012f This is how I'm calling it.$GUI_RedLight = GUICreate("Red Light", 285, 40, 165, -427, $WS_POPUP, $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) GUICtrlCreateAvi("..\AppImages\StopLightVid.avi", 0, 0, 0, 285, 40, $ACS_AUTOPLAY) GUISetState() Now when I put a full file path it works. Link to comment Share on other sites More sharing options...
Rampantshadow Posted January 6, 2016 Share Posted January 6, 2016 Hi Champak,Relative locations will not work for what you need it for, is it imperative that you have a flexible folder structuring? what I mean is are you likely to put the whole application on another computer in a folder other than the program files folder (like in someones documents for example) as that would change the folder destination. I might suggest that you have a look at the other folder options. Click here to see the options.see if any of these will help with what your trying to do. using @MyDocumentsDir for example will give you 'C:\Users\User\Documents' from there you can just add the subfoldersHope this helps a little. Link to comment Share on other sites More sharing options...
Champak Posted January 6, 2016 Author Share Posted January 6, 2016 Yeah, I think you're right. I realized other things weren't working as well, databases, gifs. So I'm using one of the folder options as you suggest. Thanks. 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