I've got the following Batch file that checks for the existence of a certain file and if it exists moves it to a folder, and renames it. If it doesnt exist it moves it to that location and renames it.
The batch file works for the latter but the former doesnt. Keeps telling me incorrect syntax.
It's the first line thats the problem, if the file is there. Any ideas please?
The batch file works for the latter but the former doesnt. Keeps telling me incorrect syntax.
Code:
If exist C:\SDS.exe MOVE C:\SDS.exe "C:\PROGRAM FILES\SOLUS3\DEPLOYMENTSERVERUI\" REN "C:\PROGRAM FILES\SOLUS3\DEPLOYMENTSERVERUI\SDS.exe" "C:\PROGRAM FILES\SOLUS3\DEPLOYMENTSERVERUI\Sims.Solus3.DeploymentServer.UI.exe" ELSE
MOVE "C:\PROGRAM FILES\SOLUS3\DEPLOYMENTSERVERUI\Sims.Solus3.DeploymentServer.UI.exe" C:\
CD C:\
REN Sims.Solus3.DeploymentServer.UI.exe SDS.exe
ECHO Solus removed
PAUSE
EXIT
It's the first line thats the problem, if the file is there. Any ideas please?