Advertisement

07.27.2005 at 01:49AM PDT, ID: 21505733
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Copy a file on a good ping

Asked by navyjax2 in MS DOS

Tags: ,

This stems from another person's work that I have adapted (rather poorly it would seem) to my own use - to copy a file to another computer on a good ping, and spit out a record when the ping fails so we can go back to that machine later, and go on to the next machine when it assesses one of those two outcomes:

I have found what I've put together doesn't loop back through the hostnames in the names.txt, it just does one host.  Was just wondering how to set that up (tabs, or one name on each line, etc.), or if it was just a code error on my part (full code below).  What I want it to do is to copy a file from one computer to another if the ping is good, skip to the next host name in names.txt if the ping times out while sending that note to a results.txt that the ping timed out, using this setup.  So far it only goes through one hostname, and will copy the file regardless of if I can ping the host or not when I make the path at the end local instead of remote.  Depending on my edits, probably my fault as I'm just getting into this, I'll get a result in my results.txt file that I got a non-response, but the file still copies, anyway...  I know that the non-response is correct, but the file copying in that instance is not.  Could I get some help cleaning this up a bit, please?  Been working at it all night and would like another pair of eyes.

echo off
cls
REM Set the file paths here --
SET ResultsFile=C:\results.txt
SET MachineList=C:\names.txt
SET VirusChecker=C:\viruschecker.bat

REM Will error out if you do not have a names.txt machine list --
CLS
ECHO.
IF NOT EXIST "%MachineList%" (
  ECHO Cannot locate Machine List: %MachineList%
  PAUSE>NUL
  GOTO EOF
)

REM Starting the procedure --
ECHO Processing all machine names in %MachineList% . . .
ECHO.

FOR /f "tokens=*" %%M in (%MachineList%) do CALL :CHECK "%%M"
goto :EOF

:CHECK

set Machine=%~1
set Machine=%Machine: =%
set TimeOut=

for /F "delims=" %%a in ('ping -w 1000 %Machine% ^| findstr "Request timed out"') do set TimeOut=Y

if not "%TimeOut%"=="Y" goto :dothecopy

echo %Machine% did not respond at %Time%>>%ResultsFile%
if %Machine%=="" goto :EOF
exit /b

:dothecopy
REM checks for VirusCheck.bat file at location specified --

ECHO Copying virus checker... please wait...
IF NOT EXIST "%VirusChecker%" (
  ECHO Cannot locate Virus Checker: %VirusChecker%
  PAUSE>NUL
  GOTO EOF
)

copy %VirusChecker% \\%Machine%\c$\Docume~1\AllUse~1\StartM~1\Programs\Startup\viruschecker.bat

:EOF
pause
cls
exit

This will help our IT security guy be able to send out startup batch scripts through our network.  I'd give it more points, but all I've got is 105, plus this did stem from another thread where they accepted the answer either before fully testing it, or they just knew what they were doing when they got the answer and put it together as they needed it, which was slightly different than my implementation.  Either way, I appreciate the help. -TomStart Free Trial
[+][-]07.27.2005 at 04:41AM PDT, ID: 14535431

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 04:45AM PDT, ID: 14535452

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 05:52AM PDT, ID: 14535985

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 03:25PM PDT, ID: 14541627

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 05:57PM PDT, ID: 14542345

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 01:45AM PDT, ID: 14543958

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 01:55AM PDT, ID: 14544004

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 03:43AM PDT, ID: 14544375

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 03:51AM PDT, ID: 14544409

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS DOS
Tags: ping, dos
Sign Up Now!
Solution Provided By: SteveGTR
Participating Experts: 4
Solution Grade: A
 
 
[+][-]07.28.2005 at 04:38AM PDT, ID: 14544612

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 09:09PM PDT, ID: 14551939

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 09:22PM PDT, ID: 14551974

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32