Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
has anyone an example how to enter a DOS-Command in a QV-macro?
I want ro rename a file within a macro
thanks
Bumin
Hi Bumin,
The below macro (vbscript) will do the job without the need for a dos command:
sub renamefile
set obj = CreateObject("Scripting.FileSystemObject")
strFile = "C:\Users\Test\Desktop\QVW\s.csv"
strRename = "C:\Users\Test\Desktop\QVW\sRenamed.csv"
if obj.FileExists(strFile) then
obj.MoveFile strFile, strRename
else
msgbox("File Doesn't Exist")
end if
set obj = nothing
end sub
Make sure to set the security flag to "allow system access".
Hope this helps.
Hi Bumin,
The below macro (vbscript) will do the job without the need for a dos command:
sub renamefile
set obj = CreateObject("Scripting.FileSystemObject")
strFile = "C:\Users\Test\Desktop\QVW\s.csv"
strRename = "C:\Users\Test\Desktop\QVW\sRenamed.csv"
if obj.FileExists(strFile) then
obj.MoveFile strFile, strRename
else
msgbox("File Doesn't Exist")
end if
set obj = nothing
end sub
Make sure to set the security flag to "allow system access".
Hope this helps.
perfect it worked with me
thanks Jean-Pierre it works
Great
Appreciate to mark the answer as correct/helpful.