• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Movefile in Windows NT 4.0 using VB

Hi,

I was trying to movefile using SHELL & FILESYSTEM object but Windows NT 4.0 is not allowing. Can someone please help me in coding ...

Please send me the code for Movefile in VB for Windows NT 4.0


Cheers,
Raj
0
rajbiswas
Asked:
rajbiswas
2 Solutions
 
vinnyd79Commented:

Name "C:\Somefile.txt" as "C:\SomeOtherFile.txt"
0
 
Julian HansenCommented:
Public Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long

Dim sSource as String
Dim sTarget as String

sSource = "c:\somefile.txt"
sTarget = "c:\somefile.dat"

MoveFile sSource, sTarget


Should do it.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now