Solved

Create tool to trouble-shoot in-house app

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem Office 2016 auto-activation using MAK Key 3 112
Event ID 1054 Userenv 2 33
Wild card search and replace using Notepad 7 21
Network adapter disconnected 4 18
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

861 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