Solved

Create tool to trouble-shoot in-house app

Posted on 2014-12-08
3
116 Views
Last Modified: 2014-12-08
Greetings to the best Experts on the web.

Here is what I am trying to accomplish.  There is an app that was written by the state that is used at various satellite offices (like this one) and getting support for it can be difficult.  So, after working with the app for several years, I've found the cause for a lot of the errors and a simple batch script could help the field techs trouble-shoot and resolve the issues.

The batch script should do the following:
1. When I launch the script from my pc, the script will prompt for the name of the computer to run on
2. I have a list of files that "should" be on the computer.  I would like to put the files that should be on that computer into this script so it can be easily checked.  Each file should be checked and if the file is on that computer, it will echo "File1.ini detected" or "File1.ini NOT detected" to a log file

Many of the service calls from the end-user is a result of missing files in the particular directory.  This tool should identify which files are there and not there.  

Thanks for your help!
0
Comment
Question by:samiam41
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
FarWest earned 500 total points
ID: 40486977
you can use vbscript


Option Explicit
DIM strFilePath 
DIM strComputer 
DIM fso    
DIM filesArray
DIM i

strComputer = InputBox( "Enter Computer Name" )
strFilePath = "\\" & strComputer & "\C$\MyPathe\" 
Set fso = CreateObject("Scripting.FileSystemObject")

filesArray= Array("file1.ini","files2.ini","file3,ini")
 For i=0 to ubound(a)
If (fso.FileExists(strFilePath +filesArray(i))) Then
  WScript.Echo("myfile1.ini File detected")
ELSE
  WScript.Echo("myfile1.ini Not File detected")
End If
NEXT

Open in new window

0
 
LVL 12

Expert Comment

by:FarWest
ID: 40486984
sorry forget to correct
WScript.Echo("myfile1.ini File detected")
to
WScript.Echo(filesArray(i)+  " File detected")
and
WScript.Echo(filesArray(i)+  " File NOT detected")
0
 
LVL 9

Author Closing Comment

by:samiam41
ID: 40487192
Thanks!  Quick and easy.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.

919 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

17 Experts available now in Live!

Get 1:1 Help Now