Hi,

 

First you need to make sure to add a reference to Microsoft Scripting
Runtime by going to the visual basic editor, then  Tools|References and
adding it there.  Next, your syntax looks fine to me, but it will not
overwrite.  You would probably want to use the copyfile command with the
overwrite Boolean set to true, then follow it with a deletefile.
Additionally, you could always add a time/date stamp on the end of the
file to ensure that there was never a duplicate.

 

Dim fso as new filesystemobject

 

Fso.copyfile
"H:\ePremis\Notes\text.txt","H:\ePremis\Notes\Archive\test.txt",True

Fso.DeleteFile "H:\ePremis\Notes\text.txt",True

 

 

Or

 

Dim fso as new filesystemobject

Dim tmpStamp as string

 

Tmpstamp = Format(Now,"YYYYMMDDHHNNSS")

Fso.MoveFile
"H:\ePremis\Notes\text.txt","H:\ePremis\Notes\Archive\text_" & tmpStamp
& ".txt"

 

Tim

 

 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Walker, Reese
Sent: Wednesday, May 21, 2008 2:06 PM
To: [email protected]
Subject: [Talk] MOVEFILE

 

I cannot get the Move File to work in VB.  Once the file has been
processed, I need it moved to the archive folder so there is no chance
of it being duplicated. This is what I am working wit so far...

 

FileSystemObject.MoveFile("H:\ePremis\Notes\test.txt",
"H:\ePremis\Notes\Archive\test.txt")

 

But I have tried different variations.

 

Object.MoveFile("H:\ePremis\Notes\test.txt",
"H:\ePremis\Notes\Archive\test.txt")

My.Computer.FileSystem.MoveFile("H:\ePremis\Notes\test.txt",
"H:\ePremis\Notes\Archive\test.txt")  as according to MSDN

 

Any help would be greatly appreciated.

 

Thanks,

 

Reese

 

Reese E. Walker
Financial Systems Analyst
Phoebe Putney Memorial Hospital
Albany, GA. 31702
Phone: (229) 312-4259
Pager: (229) 431-7658
Fax: (229) 312-4316

 

________________________________

 


Disclaimer:
The HIPAA Final Privacy Rule requires covered entities to safeguard
certain Protected Health Information (PHI) related to a person's
healthcare. Information being faxed to you may include PHI after
appropriate authorization from the patient or under circumstances
that do not require patient authorization. You, the recipient, are
obligated to maintain PHI in a safe and secure manner. You may not
re-disclose without additional patient consent or as required by
law. Unauthorized re-disclosure or failure to safeguard PHI could
subject you to penalties described in federal (HIPAA) and state
law. If you the reader of this message are not the intended
recipient, or the employee or agent responsible to deliver it to
the intended recipient, please notify us immediately and destroy
the related message.



CONFIDENTIALITY NOTICE: This message and any included attachments are from 
Salinas Valley Memorial Healthcare System and are intended only for the 
addressee.  The information contained in this message is confidential and may 
constitute inside or non-public information under international, federal, or 
state securities laws.  Unauthorized forwarding, printing, copying, 
distribution, or use of such information is strictly prohibited and may be 
unlawful.  If you are not the addressee, please promptly delete this message 
and notify the sender of the delivery error by e-mail or you may call Salinas 
Valley Memorial Healthcare System's Privacy Officer in Salinas, California, 
U.S.A. at (+1) (831) 755-0751.

Reply via email to