Jan 16, 2007 #1 bnath005 MIS Aug 19, 2005 14 US I saw only Copy, Delete methods (file scripting object). thanks nath
Jan 16, 2007 #2 PHV MIS Nov 8, 2002 53,708 FR what about the Move method ? Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
what about the Move method ? Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Jan 16, 2007 Thread starter #3 bnath005 MIS Aug 19, 2005 14 US so there is no .Rename method? thanks nath Upvote 0 Downvote
Jan 16, 2007 #4 PHV MIS Nov 8, 2002 53,708 FR Two ways: The Name property is writable ... The "Rename" method is called Move ... Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Two ways: The Name property is writable ... The "Rename" method is called Move ... Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Jan 16, 2007 #5 barny2006 MIS Mar 30, 2006 521 US phv's suggestion is preferred since it's done in vbs. however, you can use dos commands in vbs to do it: Code: wshshell.Run("cmd.exe /c ren oldfile newfile") Upvote 0 Downvote
phv's suggestion is preferred since it's done in vbs. however, you can use dos commands in vbs to do it: Code: wshshell.Run("cmd.exe /c ren oldfile newfile")
Jan 16, 2007 #6 barny2006 MIS Mar 30, 2006 521 US as per phv, the name property is writable. here's the code to do that with: Code: stPath = "C:\oldfile.txt" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.GetFile(stPath) objFile.name = "newfile.txt" Upvote 0 Downvote
as per phv, the name property is writable. here's the code to do that with: Code: stPath = "C:\oldfile.txt" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.GetFile(stPath) objFile.name = "newfile.txt"