AutoHotkey Community

It is currently May 27th, 2012, 4:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: February 17th, 2010, 10:12 pm 
Offline

Joined: November 21st, 2009, 11:06 am
Posts: 63
Hi,
I was just wondering the best way to find the current drive letter from which the script is being executed?
If will be from a usb drives in many different computers which is why i want to find out.
E.g. using driveget to find removable drive, or trimming A_ScriptFullPath down to just the first 3 characters? I know how to do this in vb6 but not ahk :(
Cheers


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2010, 10:16 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
:?:
Code:
MsgBox % SubStr(A_ScriptDir,1,2)

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2010, 11:03 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
emmm splitpath anyone
Code:
OutDrive     Name of the variable in which to store the drive letter or server name of the file. If the file is on a local or mapped drive, the variable will be set to the drive letter followed by a colon (no backslash). If the file is on a network path (UNC), the variable will be set to the share name, e.g. \\Workstation01
http://www.autohotkey.com/docs/commands/SplitPath.htm :?:

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2010, 7:23 am 
Offline

Joined: November 21st, 2009, 11:06 am
Posts: 63
haha thanks to both of you and sorry I really did do a lot of searching but wasn't able to find it surprisingly :P
using splitpath


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn and 65 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group