Solved

Create tool to trouble-shoot in-house app

Posted on 2014-12-08
3
123 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
[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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
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.

630 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