Jump to content

Recommended Posts

Posted (edited)

Greetings good folks

a 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, say

MsgBox(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?

regards

Rishav

Edited by Rishav
Posted

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.

Posted

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
Posted (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. :D

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 by Rishav
Posted

@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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...