/build/static/layout/Breadcrumb_cap_w.png

how to convert this?

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)

 

 

 


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Use the FileExits and MoveFile methods of vbscript
Posted by: adilrathore 12 years ago
4th Degree Black Belt
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

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ