/bundles/itninjaweb/img/Breadcrumb_cap_w.png

I am not a vbscript tech...  how would I convert this into vbsctript?

 

@echo off
c:
cd\
cls
cd "c:\program files\acme"
IF EXIST app1.old  (ren app1.old app1.exe) ELSE (ren app1.exe app1.old)

 

 

 

Answer Summary:
Use the FileExits and MoveFile methods of vbscript
0 Comments   [ + ] Show comments

Comments


All Answers

1

Set objShell = CreateObject("Wscript.Shell")
objShell.CurrentDirectory = "c:\program files\acme"


Set objFSO = CreateObject("Scripting.FileSystemObject")


If objFSO.FileExists("app1.old") Then
   objFSO.MoveFile "app1.old" , "app1.exe"
Else
   objFSO.MoveFile "app1.exe" , "app1.old"
End If

Answered 05/23/2012 by: adilrathore
Fourth Degree Black Belt