[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

installation counter in a batch file

Posted on 2015-02-06
5
Medium Priority
?
69 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 41

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 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This is about my first experience with programming Arduino.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
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 …
Six Sigma Control Plans

656 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