AutoHotkey Community

It is currently May 27th, 2012, 1:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: December 31st, 2011, 3:40 pm 
Offline

Joined: May 19th, 2006, 4:56 am
Posts: 166
How can I get the folder name that a selected file is in? I need to rename the file with the foldername.

_________________
Zak M.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 31st, 2011, 3:56 pm 
SplitPath wrote:
Separates a file name or URL into its name, directory, extension, and drive.
Source: http://www.autohotkey.com/docs/commands/SplitPath.htm


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 31st, 2011, 4:22 pm 
Offline

Joined: May 19th, 2006, 4:56 am
Posts: 166
Anonymous wrote:
SplitPath wrote:
Separates a file name or URL into its name, directory, extension, and drive.
Source: http://www.autohotkey.com/docs/commands/SplitPath.htm


Splitpath gets me the entire directory field, down to the root.

Ex.
C:\Downloads\Videos\Mydirectoryname

All I need is "Mydirectoryname"

_________________
Zak M.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 31st, 2011, 4:44 pm 
Code:
FullFileName=C:\Downloads\Videos\Mydirectoryname\MyHomeVideo.mp4
SplitPath, FullFileName,, Dir
Dir:=SubStr(Dir,InStr(Dir,"\",false,0)+1)
MsgBox % Dir


Report this post
Top
  
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: Amandaville, Bing [Bot], BrandonHotkey, chaosad, Yahoo [Bot] and 16 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