Solved

installation counter in a batch file

Posted on 2015-02-06
5
65 Views
Last Modified: 2016-06-23
Hello,

I would like my batch file ( executed via GPO start up script ) to record a successful installation and write to a network location

How do I incorporate this into my existing batch file listed below - ?

@echo off

if not exist "C:\Program Files\Autodesk" goto NOT

If exist "C:\Program Files\Autodesk" goto YES

:NOT

"\\server1\is$\dp2\ecs\ecs2015.lnk"

goto END
:YES
echo directory already there
goto END
:END

Nothing too fancy as batch files are not my thing !

Many thanks for suggestions.
0
Comment
Question by:joe wade
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 40594051
You're probably better off doing something like having a successful install directory.

then you can do:

hostname >> \\networkpath\successful_installs.txt


That will write the hostname of the comptuer to the text file.  This way you know which machines were successfully installed and which machines you still need to look at.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 40594086
Try this:

@echo off

  If exist "C:\Program Files\Autodesk" (
	Echo Directory already exists on %COMPUTERNAME% so no action taken >> \\server1\folder\Autodesk_Installation_Tracking.txt
) ELSE (
	"\\server1\is$\dp2\ecs\ecs2015.lnk"
	Echo Directory created on %COMPUTERNAME% >> \\server1\folder\Autodesk_Installation_Tracking.txt
)

Open in new window


Replace "folder" with location you want the Autodesk_Installation_Tracking.txt file.
0
 

Author Comment

by:joe wade
ID: 40598699
Hello pony10us,

Thanks for your suggestion. It was looking good and your code worked for a while and then stopped working.. I know that numerous desktops have ran the startup script via GPO fine but they have not written back to the Autodesk_Installation_Tracking.txt file.

Any ideas ?

Thanks
0
 
LVL 26

Accepted Solution

by:
pony10us earned 500 total points
ID: 40598835
I have added the errorlevel to the end of each line of the text file.  If successful, the error level should be "0". Anything else means there was an error performing that step.

@echo off

  If exist "C:\Program Files\Autodesk" (
	Echo Directory already exists on %COMPUTERNAME% so no action taken %ERRORLEVEL%  >> \\server1\folder\Autodesk_Installation_Tracking.txt
) ELSE (
	"\\server1\is$\dp2\ecs\ecs2015.lnk"
	Echo Directory created on %COMPUTERNAME%  %ERRORLEVEL% >> \\server1\folder\Autodesk_Installation_Tracking.txt
	
)

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about a problem I had getting the GPS LocationListener working.
Make the most of your online learning experience.
Simple Linear Regression
Starting up a Project

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question