Solved

installation counter in a batch file

Posted on 2015-02-06
5
60 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

776 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