Solved

Create tool to trouble-shoot in-house app

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ZIP or ZIPX 8 69
QR code printing 5 32
Event ID: 1202 / Source: SceCli 6 43
move command 5 29
Article by: Lee
Windows 7 Ultimate and Enterprise (and 2008 R2) introduced a new feature you may not be aware of - Boot from VHD.   Boot from VHD (or what Microsoft refers to asNative Boot allows you to install Windows to a VHD (Virtual Hard Disk) file that is t…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

707 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