Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello....

 

i want to know if its posible to rename multiple files like windows does..

 

example:

 

file zzzzzzz.doc

file asdasd.doc

file esfsefse.doc

 

if you select the three files and rename it, windows put this way..

 

file(1).doc

file(2).doc

file(3).doc

 

is there any vb.net way of doing this?

 

 

thanks!!!

 

 

PS: off course i want the easy way, some way for windows api for make it... now i am making by code, but may be, there's a way automatically... or with an api...

Posted

Sure you can do it:

Dim num As Integer = 1

'Don't know how you're selecting and renaming so this is pseduocode
For Each <selectedfile> In <selectedfilecollection>
  File.Rename(<selectedfilename>, <newname> & num & <extension>
  num += 1
Next <selectedfile>

Here's what I'm up to.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...