AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strip File Name From Path

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
icefreez



Joined: 15 May 2007
Posts: 169

PostPosted: Tue Oct 21, 2008 4:44 pm    Post subject: Strip File Name From Path Reply with quote

I have a path of say C:\folder\folder\folder\filename.exe and I would like to strip off the filename to get the path to the file only.

Is there any simple way to do this with out parsing for "\" and taking off the last parsed variable?
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1271

PostPosted: Tue Oct 21, 2008 4:52 pm    Post subject: Reply with quote

Use SplitPath.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
icefreez



Joined: 15 May 2007
Posts: 169

PostPosted: Tue Oct 21, 2008 6:13 pm    Post subject: Reply with quote

Ok thanks. I got that part working now but I can't seem to get what I would like to happen to happen properly.

What I am trying to do is launch Adobe Bridge and pass it a folder to begin at.

This is what I have so far.
Code:
SplitPath, inputpath ,, dirout
dirout =%dirout%\
msgbox, %dirout%
Run, "C:\Program Files\Adobe\Adobe Bridge CS3\Bridge.exe" %dirout%

According to this tutorial of how to add an open with option for bridge on folders I should have to just send it the format of
Quote:
"C:\Program Files\Adobe\Adobe Bridge\Bridge.exe" "%1"


Now I have the correct path for my computer to bridge, and I am passing it the directory with %dirout%, but it just doesn't seem to want to work.
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1271

PostPosted: Tue Oct 21, 2008 7:58 pm    Post subject: Reply with quote

Does dir_out contain spaces? Try putting it in quotes:

Code:
Run, "C:\Program Files\Adobe\Adobe Bridge CS3\Bridge.exe" "%dirout%"

_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
icefreez



Joined: 15 May 2007
Posts: 169

PostPosted: Tue Oct 21, 2008 8:14 pm    Post subject: Reply with quote

That did it. Thanks for your help!

I also had to remove the added "\" I had put on to the path.

Final Code that worked
Code:
SplitPath, Val_ToRun ,, dirout
Run, "C:\Program Files\Adobe\Adobe Bridge CS3\Bridge.exe" "%dirout%"
Back to top
View user's profile Send private message
jimm1909



Joined: 30 Sep 2010
Posts: 1

PostPosted: Thu Sep 30, 2010 6:56 pm    Post subject: Reply with quote

Serenity wrote:
Does dir_out contain spaces? Try putting it in quotes:
Las Vegas Strip Hotels Map 2010 Las Vegas Popular Hotels Best Cheap Vegas Show
Code:
Run, "C:\Program Files\Adobe\Adobe Bridge CS3\Bridge.exe" "%dirout%"


Awesome thanks for the response I was having the same problem. Easy fix!

-Jim
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group