[Help] How to move files?
Okay i was looking at the file killer and code from something that moved files but yet when i try to take the EXACT code just a different file to a new place it wont move and says there is an error.....anyone happen to know the code?
I have checked from the tutorials from the site it came from itself and it still says error
Code i used:
Code:
Dim Moving As String
Moving = "C:\Desktop\Older\*.png"
Dim Moved As String
Moved = "C:\Desktop\Older\*.png"
If RadioButton1.Checked = True Then
File.Move(Moving, Moved)
End If
it doesnt matter if i put %Desktop% or w/e because it "STILL" says error
vb6? or vbe?
Edit: This is what I found
imports System.IO.File
'FileToMove = "C:\test.txt"
'MoveLocation = "C:\ TestFolder\test.txt"
Youll probably need to Dim FileToMove as string and same for MoveLocation
If System.IO.File.Exists(FileToMove) = True Then
System.IO.File.Move(FileToMove, MoveLocation)
MsgBox("File Moved")
End If
Thank Me If I Helped
Are you using vb6 or express? and screen-shot the error?
oh my bad sorry um ya im using 08 and his code dont show an error but its saying it dont exist -.- (the file)
edit: nvm this works but how can i move any file that is a png? so it moves all files that is a png
Put the code in a loop?
and FileToMove = "C:\*.png
and do the same for Move Location