473,466 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Move file after import

Hi All,
Sorry if this is a basic question but I can't get this to work. I have
files randomly FTP'd to a directory and I need to import them. That I can do
but what I can't do is move them once they have been imported (Currently I
am using the Kill command). From the help file, I found the MoveFile method
but I don't get the "FileSystemObject". Syntax is: object.MoveFile source,
destination

object Required. Always the name of a FileSystemObject.
source Required. The path to the file or files to be moved. The source
argument string can contain wildcard characters in the last path component
only.
destination Required. The path where the file or files are to be moved. The
destination argument can't contain wildcard characters.

Could someone give an example of how to use this code if:
1)file to be moved is: Recxxxxx.txt
2)Directory of files to me moved = C:\Receive\
3) Directory to move files to is: C:\Receive\Log\

TIA

Mark
Nov 13 '05 #1
1 4254
I have managed to do what I wanted using :
Dim strfile As String

ChDir ("C:\Receive\")
strfile = Dir("*.txt")
Do While Len(strfile) > 0
Name "C:\Receive\" & strfile As "C:\Receive\log\" & strfile
Debug.Print strfile
strfile = Dir
Loop
MsgBox "move complete"

"Mark" <ma**********@ntlworld.com> wrote in message
news:2y****************@newsfe5-win.ntli.net...
Hi All,
Sorry if this is a basic question but I can't get this to work. I have
files randomly FTP'd to a directory and I need to import them. That I can do
but what I can't do is move them once they have been imported (Currently I
am using the Kill command). From the help file, I found the MoveFile method
but I don't get the "FileSystemObject". Syntax is: object.MoveFile source,
destination

object Required. Always the name of a FileSystemObject.
source Required. The path to the file or files to be moved. The source
argument string can contain wildcard characters in the last path component
only.
destination Required. The path where the file or files are to be moved. The
destination argument can't contain wildcard characters.

Could someone give an example of how to use this code if:
1)file to be moved is: Recxxxxx.txt
2)Directory of files to me moved = C:\Receive\
3) Directory to move files to is: C:\Receive\Log\

TIA

Mark

Nov 13 '05 #2

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

Similar topics

1
by: bmgz | last post by:
I am have made a simple script that moves all desktop clutter (ie files that are not *.lnk) to a specified folder eg. c:\myhome\mydocs\desktopdebris\2003-12-16 ...
4
by: Shagshag | last post by:
hello, here is a behavior that i discover by error : in the following example directory 'stupid' is lost such as eventual files and directory contained in it (for example 'atest.txt') while i...
7
by: Stéphane Ninin | last post by:
Hello world, I am fighting with what is probably a stupid problem. In a wxpython GUI, here is a method which must read a file, and if the file is not correctly formed rename it and create a...
3
by: \(¯`·.¸FlacK¸.·´¯\) | last post by:
Hi! I want to move a node from file "film1" to "film2" that has tag "FilmatoPartita". I have write the codo below, but it don't do anything...I don't see the error... I have forgotten something?...
4
by: Mark Reed | last post by:
Hi all, I have the following code which imports the contents of all files within a set folder which works excellently. Once it has imported from each file, it deletes the file. Is there a way that...
1
by: brian.gabriel | last post by:
I have a ASP.Net application written in VB.Net, I have a file import function that imports a file then moves the file to an archive. The problem is that the File.Move statement copies the file,...
8
by: inFocus | last post by:
Hello, I am new to python and wanted to write something for myself where after inputing two words it would search entire drive and when finding both names in files name would either copy or move...
4
by: mikkoO8 | last post by:
hi. im actually making a desktop cleaner that can move the files and icons to a folder inside the listview box. i can make the listview box filled with files contains at the desktop and i can make...
1
by: magnus.lycka | last post by:
Does anyone recognize this little Python crasher? I'll file a bug report unless someone notices it as an already documented bug. I found some open mmap bugs, but it wasn't obvious to me that...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...

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.