Jump to content
Sign in to follow this  
the_lord_mephy

Help a little debugging please

Recommended Posts

I have a lot of songs in a folder (Music) on my desktop all of which have the prefix "Dance - ". I'm trying to rename all of the files so they don't have Dance in front of them.

$first = FileFindFirstFile(@DesktopDir & "\Music\*.*")
Dim $real
Do
   $next = FileFindNextFile($first)
   If $real = "" Then
      $real = $next
   Else
      $real = $real & "|" & $next
   EndIf
Until @error = 1
;MsgBox(0, "", $real)
$songs = StringSplit($real, "|")
Dim $newnames[$songs[0] + 1]
For $i = 1 to $songs[0]
   $newnames[$i] = StringReplace($songs[$i], "Dance - ", "")
Next
;For $i = 1 to $songs[0]
;   MsgBox(0, "", $newnames[$i])
;   MsgBox(0, "", @DesktopDir & "\" & $songs[$i])
;   MsgBox(0, "", @DesktopDir & "\" & $newnames[$i])
;Next
For $i = 1 to $songs[0]
   FileMove(@DesktopDir & "\" & $songs[$i], @DesktopDir & "\" & $newnames[$i])
Next

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

Hmm I've been fooling around with them and I did a FileExists function and it returned 0 for all of those files, but I used FileFindFirstFile() Etc to find the files

Edit~~

I'm retarded. i forgot to add Music\ after @DesktopDir. Sorry :(

Edited by the_lord_mephy

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...