473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Rename a file in a filelist box

OK, I'm stumped. I'm trying to rename all the files displayed inside of a
filelist box. VB help just doesn't help - I'm using VB6

Thanks
Jul 17 '05 #1
6 8170
There's a file renaming command - Name(Original Name, New Name) - I think
it's VBA, but nevertheless, it works fine. You should be able to find it in
the MSDN.
Alternatively, I used to use the FileSystemObject if I had a lot of
folder/file changes to make.
______________________________
The Grim Reaper

"RudyL" <q2*****@comcast.net> wrote in message
news:Kc********************@comcast.com...
OK, I'm stumped. I'm trying to rename all the files displayed inside of a
filelist box. VB help just doesn't help - I'm using VB6

Thanks

Jul 17 '05 #2
On Mon, 5 Jul 2004 07:29:55 -0500, "RudyL" <q2*****@comcast.net>
wrote:
OK, I'm stumped. I'm trying to rename all the files displayed inside of a
filelist box. VB help just doesn't help - I'm using VB6


A short example (5 lines) of your code would be helpful
Jul 17 '05 #3
> There's a file renaming command -
Name(Original Name, New Name)
Actually, the syntax is: Name OldName As NewName

In addition, you should specify the complete path with both of those
names.
Alternatively, I used to use the FileSystemObject
if I had a lot of folder/file changes to make.


You should consider discarding that as an option because it is slow,
adds overhead, requires an extra DLL in distribution, can exist in
multiple non-compatible versions on user systems, can be disabled on a
computer as part of anti-virus security measures and offers nothing that
can't be done with plain VB statements and/or a couple of API calls.

Rick - MVP

Jul 17 '05 #4
Thank you for your response. The Name command is the first thing I tried. I
think your suggestion to use FileSytemObject has me on the correct track.

Rudy L.

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@titan.btinternet.com...
There's a file renaming command - Name(Original Name, New Name) - I think
it's VBA, but nevertheless, it works fine. You should be able to find it in the MSDN.
Alternatively, I used to use the FileSystemObject if I had a lot of
folder/file changes to make.
______________________________
The Grim Reaper

"RudyL" <q2*****@comcast.net> wrote in message
news:Kc********************@comcast.com...
OK, I'm stumped. I'm trying to rename all the files displayed inside of a filelist box. VB help just doesn't help - I'm using VB6

Thanks


Jul 17 '05 #5
Sorry, I forgot the syntax because I've been using .NET for over a year now.

I was simply suggesting an "easy" way to iterate the filesytem and/or rename
files. The OP sounded like the simplest approach would help. There was no
suggestion of project details or distribution requirements.
You really think newbies would instantly think of using API calls??
_____________________________
The Grim Reaper

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:Tv********************@comcast.com...
There's a file renaming command -
Name(Original Name, New Name)


Actually, the syntax is: Name OldName As NewName

In addition, you should specify the complete path with both of those
names.
Alternatively, I used to use the FileSystemObject
if I had a lot of folder/file changes to make.


You should consider discarding that as an option because it is slow,
adds overhead, requires an extra DLL in distribution, can exist in
multiple non-compatible versions on user systems, can be disabled on a
computer as part of anti-virus security measures and offers nothing that
can't be done with plain VB statements and/or a couple of API calls.

Rick - MVP

Jul 17 '05 #6
I wasn't stumped after all, just not observant. The varialbes that I was
passing to the name command didn't specify the full path.

Thanks everybody for responding.
"RudyL" <q2*****@comcast.net> wrote in message
news:Kc********************@comcast.com...
OK, I'm stumped. I'm trying to rename all the files displayed inside of a
filelist box. VB help just doesn't help - I'm using VB6

Thanks

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Bryan | last post by:
i'm curious to know how others handle the closing of files. i seem to always end up with this pattern even though i rarely see others do it. f1 = file('file1') try: # process f1 finally:...
15
by: TaeKyon | last post by:
I'm a python newbie; here are a few questions relative to a problem I'm trying to solve; I'm wandering if python is the best instrument or if awk or a mix of bash and sed would be better: 1) how...
24
by: Joerg Schuster | last post by:
Hello, I am looking for a method to "shuffle" the lines of a large file. I have a corpus of sorted and "uniqed" English sentences that has been produced with (1): (1) sort corpus | uniq >...
1
by: James Johnston | last post by:
I've never written a Python program before and I'm trying to read a config file with file path/names (eg. c:\\python24\\*.dll, ... *.exe) to create an output file of filename + md5 values. I'm...
16
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
10
by: SamG | last post by:
How could i make, from inside the program, to have the stdout and stderr to be printed both to a file as well the terminal(as usual).
10
by: kriz4321 | last post by:
I have many files in a dirctory in which I need to make the common subsitution. I need to delete all lines between two matched patterns I need to match a line having words " chkstats to...
2
by: nothing1 | last post by:
Here is my code and what it does is create a page for every directory with the contents of choice. Its been working on all letters except "u" I can't seem to figure it out. Does someone see the...
0
by: Matt Nordhoff | last post by:
Taygun Kekec wrote: Why are you executing another program just to delete a file? --
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.