Custom Search

Wednesday, March 25, 2009

File Rename through QTP

dim spath,fso,f,sname
if count(wscript.arguments)<>0 then
spath=wscript.arguments(0)
set fso=createobject("scripting.filesystemobject")
'this is in the rightclick menu, so it can spare further test for existence, otherwise, you should.
if fso.fileexists(spath) then
set f=fso.getfile(spath)
sname=f.name
f.name=sname & ".original"
set f=nothing
end if
set fso=nothing
end if

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.