473,513 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't rename file

I am attempting to rename a file in VB.net using the MSDN rename function
example at

http://msdn.microsoft.com/library/de...afctrename.asp

My code looks like this:

Imports System.IO

..

..

..

Dim OldName As String = "C:\PDB\Development\Database\PDB.mdb"

Dim NewName As String = "C:\PDB\Development\Database\OldPDB.mdb"

Rename(OldName, NewName)

When the rename is executed, I get:

Procedure call or argument is not valid

Any ideas?

TIA,

John


Nov 21 '05 #1
1 3004
Nevermind. I fould that the problem was that the file was open.

"John Howard" <jo*********@dcf.state.fl.us> wrote in message
news:41******@news.hcs.net...
I am attempting to rename a file in VB.net using the MSDN rename function
example at

http://msdn.microsoft.com/library/de...afctrename.asp
My code looks like this:

Imports System.IO

.

.

.

Dim OldName As String = "C:\PDB\Development\Database\PDB.mdb"

Dim NewName As String = "C:\PDB\Development\Database\OldPDB.mdb"

Rename(OldName, NewName)

When the rename is executed, I get:

Procedure call or argument is not valid

Any ideas?

TIA,

John

Nov 21 '05 #2

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

Similar topics

1
3697
by: Bob Bedford | last post by:
I've tried everything seen on Internet, but nothing works: I'm trying to move a file from a dir to a subdir (WinXP Pro, Apache, PHP 4.3.3) Here is the code: chmod($XMLPath, 0777);...
18
9072
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
3
5747
by: Venkat | last post by:
Hi All, Currently i guess rename and remove are not supported using fstream. How do i rename or remove a file? regards, Venkat
16
2956
by: dudufigueiredo | last post by:
I have one folder containing mp3 files, the folder is: C:\My Shared Folder\Rubber Soul And the files are: 01 drive my car.mp3 02 norwegian wood.mp3 03 you won't see me.mp3 04 nowhere man.mp3...
2
4885
by: andrewcw | last post by:
Is there a simpler way to rename a file other than copy the source file to the target file, then deleting the source file ? { i did not see any rename in the File class )
1
1986
by: Jay at SCA | last post by:
I've been having the following issue with a windows service I've created in vb.net (.net fw 1.1): Basically, my service monitors a folder for the creation of any new files of a particular type...
2
3613
by: =?iso-8859-1?b?cultaQ==?= | last post by:
Hi, I would like to rename files (jpg's ones) using a text file containing the new names... Below is the code that doesn't work : ***** #!/usr/bin/python #-*- coding: utf-8 -*- from os...
1
5896
by: Alien | last post by:
Hi, I am new to PHP and trying to move a zip file from one directory to another. I researched on the web on this and all fingers pointed to this rename() function. I tried writing a PHP script...
1
5688
by: achotto | last post by:
hi, i try to upload a multiple image files. after that i will rename the files name. the problem is when i upload a 2 or more same files name exp-goal.jpg, it will return "files already exist". ok...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7106
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5689
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5094
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3236
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1601
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.