Rishav Posted March 23, 2009 Share Posted March 23, 2009 (edited) Greetings good folksa simple question;i have a variable defined for a folder path as;$RateSheetDIR="..\..\input files\Rate Sheets\"I want to use the variable in a script, sayMsgBox(0,"", $RateSheetDIR)but I want to use omplete windows folder path;c:\program files\autoit\samples\input files\Rate Sheets\instead of the path I have given "..\..\input..."any suggestions?regardsRishav Edited March 24, 2009 by Rishav Link to comment Share on other sites More sharing options...
jvanegmond Posted March 23, 2009 Share Posted March 23, 2009 Your previous topic was about the exact same thing: http://www.autoitscript.com/forum/index.php?showtopic=91683Please don't create more than one thread on an issue and don't bump that.The solution to your problem is using simple string operations on @ScriptDir and appending the rest. SIMPLE. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Rishav Posted March 23, 2009 Author Share Posted March 23, 2009 Sorry Manadar, but no. The previous topic contained no issue at all. It kept failing because of a stupid spelling mistake. If you read the two, they are quite different, though they sound similar. I can see why you might have mistaken them to be the same. anyway, I can't really use @scriptdir, @workingdir and such. I have just a folder path ".\..\etc" hand have to expand it to the full windows path. Link to comment Share on other sites More sharing options...
jvanegmond Posted March 23, 2009 Share Posted March 23, 2009 @WinDir and string operations. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Authenticity Posted March 23, 2009 Share Posted March 23, 2009 Maybe this: Dim $sRelPath = InputBox('Working directory', _ 'Current working directory is: ' & @LF & '"' & @WorkingDir & '"', @WorkingDir & '\..', '', 400, 140) If $sRelPath <> "" Then If StringLeft($sRelPath, 2) = '\.' Then MsgBox(0x40, 'Relative path', 'Relative path is:' & @LF & FileGetLongName($sRelPath & @WorkingDir, 1)) Else MsgBox(0x40, 'Relative path', 'Relative path is:' & @LF & FileGetLongName($sRelPath, 1)) EndIf EndIf Link to comment Share on other sites More sharing options...
Rishav Posted March 24, 2009 Author Share Posted March 24, 2009 (edited) thank you guys. @Authenticity; FileGetLongName sounds exactly like the command I am looking for. I'll check it out as soon as I reach home. Thanks again. EDIt: ok my enthusiasm didn't really pan out. will have to take another look at what I am doing wrong. a conceptual question. What exactly is the @workingdir? is it like a variable to which you can assign any directory path to? Edited March 24, 2009 by Rishav Link to comment Share on other sites More sharing options...
ResNullius Posted March 25, 2009 Share Posted March 25, 2009 Have you looked at _PathFull() (from File.au3) in the help file? Link to comment Share on other sites More sharing options...
DaRam Posted March 25, 2009 Share Posted March 25, 2009 @workingdir = Current/active working directory the script or compiled EXE is run from.No you cannot assign anything to it or other macro constants.Any word prefixed with an @ character is an AutoIt Macro, search help file for 'Macro'a conceptual question. What exactly is the @workingdir? is it like a variable to which you can assign any directory path to? 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