Solved

installation counter in a batch file

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now