Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think this is what you are looking for.. I have worked with Bill Stewart many years ago on some scripting items and he is a reliable resource..</p> <p><a href="http://social.technet.microsoft.com/Forums/windows/en-US/52873f35-5d55-498c-949e-da8ceb1df980/vbscript-write-error-to-log-file" rel="nofollow">http://social.technet.microsoft.com/Forums/windows/en-US/52873f35-5d55-498c-949e-da8ceb1df980/vbscript-write-error-to-log-file</a></p> <p>Two items of notice:</p> <pre><code>On Error Resume Next </code></pre> <p>Is a line you would need to add to your VBScript.</p> <p>Setup a batch file to run:</p> <pre><code>@echo off ECHO %COMPUTERNAME% &gt;&gt; C:\Scripts\errors.txt cscript C:\Scripts\myScript.vbs 2&gt;&gt; C:\Scripts\errors.txt </code></pre> <p>Now, this should trap issues seen and should log for you.</p> <p>Ok.. You asked to have a list (text) list of servers.. Try something like this.. You really don't need the VBScript to do this..</p> <pre><code>:: http://www.robvanderwoude.com/files/servers_nt.txt :: Check all servers in the list FOR /F "tokens=*" %%A IN ('TYPE servers.txt') DO ( ECHO %%A &gt;&gt; C:\Scripts\errors.txt IF NOT EXIST \\%%A\c$\CL_Repair\. ECHO CREATING FOLDER \\%%A\c$\CL_Repair &gt;&gt; C:\Scripts\errors.txt IF NOT EXIST \\%%A\c$\CL_Repair\. MD \\%%A\c$\CL_Repair IF NOT EXIST \\%%A\c$\CL_Repair\somefile.exe ECHO copying somefile.exe \\%%A\c$\CL_Repair &gt;&gt; C:\Scripts\errors.txt IF NOT EXIST \\%%A\c$\CL_Repair\somefile.exe copy c:\CL_Repair\somefile.exe \\%%A\c$\CL_Repair IF NOT EXIST \\%%A\c$\CL_Repair\anotherfile.bat ECHO copying anotherfile.bat \\%%A\c$\CL_Repair &gt;&gt; C:\Scripts\errors.txt IF NOT EXIST \\%%A\c$\CL_Repair\anotherfile.bat copy c:\CL_Repair\anotherfile.bat \\%%A\c$\CL_Repair) GOTO End :END EXIT </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload