1

I am using Group Policy to deploy a computer startup script that tries to uninstall one program and install another. I need this script to report its status (whether a certain file exists on the system, which would mean that the installation succeeded).

My first idea was to mount a network share and drop a text file in there. Is there a better way to do this? Right now, I am using a batch file, although I would be open to learning a bit of PowerShell if it was the best option.

stephenwade
  • 140
  • 1
  • 8
  • did you mean "uninstall one program and INSTALL another" – tony roth Aug 13 '13 at 14:24
  • Oh dear. Fixed. – stephenwade Aug 13 '13 at 14:53
  • Also do these applications use window compliant installers? As in uses the msi installer? – tony roth Aug 13 '13 at 15:13
  • Yes, they use MSI installers, though that should be irrelevant. I need to check for the presence of two files, actually, one for some cleanup the script does, and one for the installation. – stephenwade Aug 13 '13 at 15:16
  • well if the msi components are working correctly then you wouldn't have to worry about file remenants, also msi's can have logging enabled... – tony roth Aug 13 '13 at 15:29
  • As the question title says, I need the script to report its success back to me, not to a log file on the computer. Also, as I said in the last comment, one of the file checks is not related to the MSI, but is "for some cleanup the script does". – stephenwade Aug 13 '13 at 15:39

2 Answers2

0

Honestly, I would probably use the text file. On success:

echo %COMPUTERNAME% >> z:\path\success.txt

On failure:

echo %COMPUTERNAME% >> z:\path\failure.txt

Someone else might have something that works better, though.

Katherine Villyard
  • 18,550
  • 4
  • 37
  • 59
0

I use the network share method personally then I have our monitoring application check that folder periodically for files matching "error*.log" and fire off an alert if there is one.. that's for our servers. For our workstations our tech support staff checks it around lunch time and makes a list of systems they need to visit, doesn't happen often.