DeeRiee Posted August 17, 2008 Share Posted August 17, 2008 I'm newbie here, and i want to ask about how to select the file name in file path? example: d:\document\autoit.exe How to select only the autoit.exe Please tell me script that can select file name in any path and file name Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 17, 2008 Share Posted August 17, 2008 $path = "d:\document\autoit.exe" $array = StringSplit($path,"\") $name = $array[$array[0]] MsgBox(64,"Name",$name) Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
smashly Posted August 17, 2008 Share Posted August 17, 2008 Another way:$sPath = "d:\document\autoit.exe" $sFileName = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) ConsoleWrite($sFileName & @LF) Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 17, 2008 Share Posted August 17, 2008 There is also _PathSplit(), but it may be excessive depending on what you are doing .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
rasim Posted August 17, 2008 Share Posted August 17, 2008 More solutions: $path = "d:\document\autoit.exe" $file = StringRegExpReplace($path, "^.*\\", "") ConsoleWrite($file & @LF) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 17, 2008 Moderators Share Posted August 17, 2008 More solutions: $path = "d:\document\autoit.exe" $file = StringRegExpReplace($path, "^.*\\", "") ConsoleWrite($file & @LF) Ha, nice... I do that much more complicated. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
DeeRiee Posted August 17, 2008 Author Share Posted August 17, 2008 $path = "d:\document\autoit.exe" $array = StringSplit($path,"\") $name = $array[$array[0]] MsgBox(64,"Name",$name)Thanks, It's Work Link to comment Share on other sites More sharing options...
DeeRiee Posted August 17, 2008 Author Share Posted August 17, 2008 Another way:$sPath = "d:\document\autoit.exe" $sFileName = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) ConsoleWrite($sFileName & @LF)Working, Thanks Link to comment Share on other sites More sharing options...
DeeRiee Posted August 17, 2008 Author Share Posted August 17, 2008 THANK'S ALL FOR HELPING ME!!!!! Link to comment Share on other sites More sharing options...
euverve Posted March 8, 2009 Share Posted March 8, 2009 Thanks for the share guys... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now