Solved

Batch File: "Port Reporter" Remote installation

Posted on 2010-09-08
13
540 Views
Last Modified: 2012-05-10
Hi there,

I did this batch file to install Port Reporter on all PCs on my network.

Everything in this script works, but the installation fails with an error code 1.

By the way, I am a Domain Admin.

Could you please tell me what I did wrong?

Thanks for your help,
Rene
@ECHO OFF



SETLOCAL ENABLEDELAYEDEXPANSION



FOR /F %%A IN ('net view ^| findstr \\PC') DO (

	ECHO %%A

	SET Destination=%%A\c$\Temp\PortRptr

	IF NOT EXIST "!Destination!" MD "!Destination!"

	COPY ".\PortRptr" "!Destination!"

	PSEXEC %%A C:\Temp\PortRptr\pr-setup.exe /a /s

	IF !errorlevel! NEQ 0 (ECHO %%A FAILED>>%~n0.log) ELSE (ECHO %%A SUCCESS>>%~n0.log)

	RD /S /Q "!Destination!"

)



PAUSE

Open in new window

0
Comment
Question by:ReneGe
  • 8
  • 4
13 Comments
 
LVL 52

Expert Comment

by:Bill Prew
ID: 33632766
Where do you see the error code?  Can you tell if the setup.exe program actually gets started on the remote PC, or not?

~bp
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33632817
I see the error code on screen
Also in the log file
@echo off



SETLOCAL ENABLEDELAYEDEXPANSION



FOR /F %%A IN ('net view ^| findstr \\PC') DO (

	ECHO %%A

	SET Destination=%%A\c$\Temp\PortRptr

	IF NOT EXIST "!Destination!" MD "!Destination!"

	COPY ".\PortRptr" "!Destination!"

	PSEXEC %%A C:\Temp\PortRptr\pr-setup.exe /a /s

	SET Result=!errorlevel!

	IF !Result! NEQ 0 (ECHO %%A FAILED [!Result!]>>%~n0.log) ELSE (ECHO %%A SUCCESS>>%~n0.log)

	RD /S /Q "!Destination!"

)



PAUSE

Open in new window

0
 
LVL 52

Accepted Solution

by:
Bill Prew earned 375 total points
ID: 33643121
Does this happen for all computers in the list file, or just some?

Have you tried executing just the psexec from a command line?

Does the setup program actually run on the remote?

Have you tried running some other program like notepad?

~bp
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33643273
Yes to all

Thanks,
Rene
0
 
LVL 52

Expert Comment

by:Bill Prew
ID: 33643287
Not sure then, you running the latest PSEXEC, I read that there were some quirks with the errorlevel in early versions.

~bp
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33643296
I'll look at it. Will let you know.

Thanks
0
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 
LVL 22

Assisted Solution

by:Adam Leinss
Adam Leinss earned 125 total points
ID: 33647830
Not much more to offer, but you could try PSEXEC -s -i %%A which uses the LOCALSYSTEM to do the install and -i for interactive to allow it access to the desktop environment.
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33647880
==>aleinss

Thanks, did'nt think of that one.

I'll test and come back!

Cheers,
Rene
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33647908
==>aleinss

Still does not work

Thanks for your contribution

Cheers,
Rene
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33649532
==> billprew

My version was 2008. I updated it and still same problem.

I can't put more time on this so I'll close this threar and distribute points considering the level of contribution.

Thanks guys,
Rene
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33649570
If you have any further odeas, would you mind sharing?

Thanks and cheers,
Rene
0
 
LVL 52

Expert Comment

by:Bill Prew
ID: 33652925
Rene,

Thanks for the credit, sorry I wasn't more help on this one.

~bp
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33653181
It' cool Bill!

Cheers,
Rene
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Layer 2 versus layer 3 10 51
Suggestions for hosted VOIP 5 47
Linksys 4 port wireless router 62 43
Network access 4 21
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

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

16 Experts available now in Live!

Get 1:1 Help Now