Jump to content

Search the Community

Showing results for tags 'r01'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Dear AutoIt members, I want to make a simple script: rename file-name (inputbox) with the extension rar if the extension ends up with part001.rar, part002.rar and so on rename to r01, r02 renaming the the extension is not the problem i found on this forum a good example script now renaming the filename with the given inputbox name FileMove($Directory & "\" & $files[$x], $Directory & "\" & $Input1[1] & ".r0" & $x)above code is wrong it was FileMove($Directory & "\" & $files[$x], $Directory & "\" & $files[1] & ".r0" & $x) this is just for example to show #NoTrayIcon #include <file.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Local $Directory = @ScriptDir Local $Gui, $Input1, $Button1, $nMsg, $i $Gui = GUICreate("Form1", 184, 91, 192, 124) $Input1 = GUICtrlCreateInput("", 24, 16, 144, 21) $Button1 = GUICtrlCreateButton("Button1", 24, 48, 145, 25, $WS_GROUP) GUISetState(@SW_SHOW) $i = 1 While 1 If GUICtrlRead($Input1) = "" And $i = 1 Then GUICtrlSetState($Button1, $GUI_DISABLE) $i = 0 Else If $i = 0 And GUICtrlRead($Input1) <> "" Then GUICtrlSetState($Button1, $GUI_ENABLE) $i = 1 EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _rar01() EndSwitch WEnd Func _rar01() Local $files, $filename, $x $files = _FileListToArray($Directory, "*.rar", 1) For $x = 1 To UBound($files) - 1 $filename = StringSplit($files[$x], ".") If $x < 10 Then FileMove($Directory & "\" & $files[$x], $Directory & "\" & $Input1[1] & ".r0" & $x) Else FileMove($Directory & "\" & $files[$x], $Directory & "\" & $Input1[1] & ".r" & $x) EndIf Next EndFunc Thanks
×
×
  • Create New...