Hi I currently have a working script with some simple logic to it. I'd like to add this type of line in 4 places on the script so we can kind of track if a user ran the script or not and which part of the script was or wasn't ran.
The working script with out the logging is this:
@echo off
if exist "C:\Program Files (x86)\IntelliChief\IntelliChief Clients\Login Client\Newtonsoft.Json.xml" GOTO ENDSCRIPT 
If exist "C:\Program Files (x86)\IntelliChief\IntelliChief Clients\Login Client\FiddlerCore4.dll" (Call "C:\Program Files (x86)\InstallShield Installation Information\{3E1***35-24F9-49D9-9A39-F310D8C25A6E}\setup.exe"/uninstall) ELSE (call \\******.com\files\it\packages\Intellichief4\ICsetup\setup.exe /silent -Env ic01system.*******.com 10800 -WB -PR) 
I'd like to add Lines like this to the script in all 3 actions.
The script first checks if v.4 of the application is installed, if it is it ends the script. Then the script sees if v.3 of the application is installed and if it is it runs an uninstallation or if application is not installed it will install v.4 of the application and end.
I'd like to add this line 3 times :
1 for "Application is already installed" 1 for "Uninstalling Application" 1 for "Installing v.4 of Application"
This script will have to be ran twice by people with the old version so that they can get it uninstalled, reboot and then click it again to start the installation of the new version.
ECHO "IntelliChief v.4 is already installed" >> "\\******.com\files\Diagnostics\Logon\Workstations\IntelliChief4\%COMPUTERNAME%_%USERNAME%.txt"
This is how I tried to make the script but it took the first script that is working and broke it. I failed. :(
@ECHO OFF
if exist ("C:\Program Files (x86)\IntelliChief\IntelliChief Clients\Login 
Client\Newtonsoft.Json.xml"); THEN 
ECHO "IntelliChief v.4 is already installed" >> 
\bakertanks.com\files\Diagnostics\Logon\Workstations\IntelliChief4\%COMPUTERNA ME%%USERNAME%.txt GOTO ENDSCRIPT If exist ("C:\Program Files (x86)\IntelliChief\IntelliChief Clients\Login Client\FiddlerCore4.dll"); THEN (Call "C:\Program Files (x86)\InstallShield Installation Information\ {3E189F35-24F9-49D9-9A39-F310D8C25A6E}\setup.exe"/uninstall) ECHO "Uninstalling IntelliChief v.3" >> \bakertanks.com\files\Diagnostics\Logon\Workstations\IntelliChief4\%COMPUTERNAM E%%USERNAME%.txt ELSE (call \bakertanks.com\files\it\packages\Intellichief4\ICsetup\setup.exe /silent -Env ic01system.bakertanks.com 10800 -WB -PR); THEN ECHO "Installing IntelliChief v.4" >> \bakertanks.com\files\Diagnostics\Logon\Workstations\IntelliChief4\%COMPUTERNAM E%_%USERNAME%.txt
:ENDSCRIPT
I can't seem to get the format to work with UNC paths, it won't let me do four spaces.
echocommands outside the parentheses of theif ... ( ... ) else ( ... )statements: i.e.if ... ( ... ) echo something else ( ... )They need to be inside the parentheses. (And probably split onto multiple lines for clarity).