Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting the Source Drive Mac is run from?
#1
how can you get the Source Drive that an exe is opened from or qm is run from?
#2
str s.getwinexe(win() 1)
out s
#3
craig1983 Wrote:str s.getwinexe(win() 1)
out s

Thanks for the help but that just give me this
C:\Windows\explorer.exe
im looking more for just the drive letter it is run from or the folder maybe.
or a way to set a working folder for it to look in to..

test\test.exe when this runnings on a usb drive i need to find a text file that would be in the folder above the test.exe like
test.txt
or
test text files here\test.txt

now i need to get to that file when this is run from a usb drive or any drive like cd or dvd.
#4
in Exe using the function GetCurDir you will receive the location of the exe being run.

Macro
Code:
Copy      Help
str directory = GetCurDir
sel directory[0]
,case 'C':
,,out "C Drive"
,case else:
,,out "Not C Drive"
#5
LyLerK Wrote:in Exe using the function GetCurDir you will receive the location of the exe being run.

Macro
Code:
Copy      Help
str directory = GetCurDir
sel directory[0]
,case 'C':
,,out "C Drive"
,case else:
,,out "Not C Drive"


Not sure but that dont help me find it unless i add like 10 case or more in there right one for each drive letter a pc might have i know mine goes up to j sometimes is there now an easy code to just find the source drive letter?
#6
Macro
Code:
Copy      Help
str direct = GetCurDir
int mark
out direct
;;to just get letter of drive
str let = " "
let[0] = direct[0]
out let
;;if you want more use get
let = ""
let.get(direct 0 3)
out let
;;go up a directory
for _i direct.len 0 -1
,if direct[_i] = '\'
,,mark = _i
,,break
direct.get(direct 0 (mark+1))
out direct
;;add your other folder and text file
str sampleTextfile = "test text files here\text.txt"
direct + sampleTextfile
out direct
#7
thanks out ill try that out
#8
Thanks.. It works great just what i was looking for.


Forum Jump:


Users browsing this thread: 1 Guest(s)