How can I have a .bat file write to a .txt file when ran through Scripts?
I have a clunky installer that will only run when a user is logged in. I am looking for a way to track this through a .txt log file.
This is the command being ran that I am not getting output for:
ECHO %Date%,%time%,%computername%,%username%,Before - %VERIFYFILEEXISTS%,After - %AFTERVERIFYFILEEXISTS%>>"C:\IS\Logs\Log.txt"
The Log.txt file already exists on the workstation. Ideally I would want this stored on the network, but for now I just want to try and get it working locally so I know it isn't a permissions issue.
If your script is running as system (the default option), then your %username% isn't going to work (unless you are setting it previously).
Can you use a managed install instead of a script to deploy the software? If so, then you can set the option to only install when a user is logged into the computer.