ur

change file name in path

3 posts in this topic

I have an ini file which has structure as below.

"C:\Users\TEJA\Desktop\Capture.PNG&

And I want to use this value and change only the file name in below path of another ini file.

 

Can you suggest any approach.

Capture.PNG

Capture.PNG

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

FileMove(ABC_Full_path_FileName, To_DEF_Full_path_FileName, 1)

ABC_Path can equal DEF_Path . So You can rename file :)

Edited by meoit

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • 31290
      Extract "never the same" string from filename
      By 31290
      Hi everyone
      Hope you're doing great today.
      Well, I have a little question about extracting a certain string from a file name to make comparison after treatment.
      Let's get into the details:
      First of all, I gather and store a machine BIOS Version by running this:
      RunWait(@ComSpec & " /c " & "wmic bios get SMBIOSBIOSVERSION >> C:\Drivers\Tag.txt" & @CRLF, "", @SW_HIDE, "$STDOUT_CHILD") _FileWriteToLine("c:\Drivers\BIOS_Version.txt", 1, "", 1) $sContent = FileRead ("C:\Drivers\BIOS_Version.txt") $sContent = StringRegExpReplace($sContent, " ", "") Result is, for example, A10
      Then, I download the latest available BIOS version from the Dell related model website and the filename of the latest BIOS is stored in a $sBIOSName variable.
      Result is for example, E5440A14.exe
      What i can't figure out is how to extract the Bios name stored in the $sBIOSName knowing that each model this app would run won't have the same number of chars.
      Indeed, I have some OPL790AXX.exe / OPL7010AXX.exe / E5470AXX.exe etc...
      I imagine something like getting the whole string, left trimming it to the first A found count 2 chars on the right and store them to have the possibility to make the check between A10 and A14 (as the number of char of filenames is never the same)
      Hope this is clear  If not, don't hesitate to ask for more.
      Thanks in advance for the help
       
    • Katie_Deely
      Get file extension from incomplete path
      By Katie_Deely
      Hi
      Let's say I get a path called "E:\pics\". It has pictures inside which are numbered starting at 0. Then we get something like "E:\pics\0" or "E:\pics\1" or "E:\pics\2"... The amount of numbers, thus the path of the last picture, are known to me already. For example, there are 100 pictures, which means that the files start at 0 and end at 99
      However, for some things that isn't enough, because they need the file extension. They can be pretty "random", though. Sometimes it's a JPG, sometimes it's a PNG, sometimes it's a GIF.
      So, I know need some kind of function that gets me the file extension, or the complete path, from an incomplete path. The input would be "E:\pics\1" and I expect and output of "E:\pics\1.jpg" for example.
      Also, there is just one file extension per number. For example, it there is "E:\pics\1.jpg", there won't be a "E:\pics\1.png" anymore.
      And this will be looped as well. First I get number 0, then number 1, then number 2, and so on. So I need something that is able to be repeated in a for-loop without causing problems with the parameters.
      Thanks a lot!
    • Scottswan
      Copy folder and file names and write them to a text file
      By Scottswan
      Basically I'm looking to make a snapshot of a whole HD's folders and files in one text file. Just the names. Preferably in alphabetical order.
      Folder 1
          File 1
          File 2
          File 3
      Folder 2
         Etc

      Is there a function that can copy just the names without opening the files? An alternative would be to put each into rename mode and then copy the text, but that is going to be painfully slow.
      Thanks.
    • Shadow_Delta
      How to Get Folder Path
      By Shadow_Delta
      How to select a folder and assign the path value to a variable in autoit?

       
      ; Selecting a file and assigning that to $sPath value) Case $file $sPath = FileOpenDialog("Open a file", @desktopdir, "Cabinet Files (*.cab)",$FD_MULTISELECT) GUICtrlSetData($file, $sPath) ; How to do the same with a folder? Case $folder $sPath = FileSelectFolder($sPath, "") Need the selected folder path to be used in the $sPath section for further implementation.
      Or a method to Select Folder or Files at once.
    • antonioj84
      How do I select a specific path in SysTreeView32
      By antonioj84
      ;Hi there I am trying to to search a specific path c:\Documents and settings\rogers\Local Settings ;the code below work but can someone point how to define the path directly, instead of searching the folder then click to select and so on ; this code below work, it finds each folder click until Local settings $hWnd5 = WinGetHandle($Title,"") Sleep(300) $hlist = ControlGetHandle($hWnd5, "", "SysListView322") $listid = _GUICtrlListView_FindText($hlist,"Documents and Settings" ) _GUICtrlListView_ClickItem($hlist, $listid, "left", False, 2) Sleep(100) $hlist = ControlGetHandle($hWnd5, "", "SysListView322") $listid = _GUICtrlListView_FindText($hlist,"rogers" ) _GUICtrlListView_ClickItem($hlist, $listid, "left", False, 2) Sleep(100) $hlist = ControlGetHandle($hWnd5, "", "SysListView322") $listid = _GUICtrlListView_FindText($hlist,"Local Settings" ) _GUICtrlListView_ClickItem($hlist, $listid, "left", False, 1) **************************************************************************************************************************************************************** ;This code below does Not work some ideas ;$spath = "C:\" ;$sgettext = ControlTreeView($Title,"","SysTreeView322", "select", $spath) ;$spath = "C:\ | Documents and Settings" ;$sgettext = ControlTreeView($Title,"","SysTreeView322", "select", $spath) ;$spath = "Documents and Settings | rogers" ;$sgettext = ControlTreeView($Title,"","SysTreeView322", "select", $spath) ;$spath = "Documents and Settings | rogers| Local Settings" ;$sgettext = ControlTreeView($Title,"","SysTreeView322", "select", $spath) ;ConsoleWrite($spath &@CRLF) ;$Selectall = ControlListView($hWnd5, "", "SysListView322", $sgettext) ;$Finditem = ControlListView($hWnd5, "", "SysListView322", "Finditem", "Local Settings") ;$Select = ControlListView($hWnd5, "", "SysListView322", "Select",$Finditem) ; consolewrite($Select)