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
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

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

Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share