how can I detect,if a network driver is installed on my PC?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
caomeisanhao
Junior Coder
Posts: 28
Joined: Wed Jun 08, 2005 2:48 pm

how can I detect,if a network driver is installed on my PC?

Post by caomeisanhao » Mon Jul 18, 2005 1:14 pm

Hi,guys

how can I detect,if a network driver is installed on my PC or not ?

To detect file exists or not we use : Iffileexists>...
To detect Directory exists or not we use: IfDirexists>...

but to detect a network driver installed on a PC or not we use: ???

thanks in advance!

Luciano
Junior Coder
Posts: 31
Joined: Fri Feb 11, 2005 1:10 pm
Location: Ghent, BELGIUM

Post by Luciano » Mon Jul 18, 2005 5:16 pm

Hi,

If you want to test the existence of a file or directory on a network drive, use the following command.


IfFileExists>\\server_XYZ\dir_XYZ\file_XYZ,found,not_found
IfDirExists>\\server_XYZ\dir_XYZ,found,not_found


Note it can take several seconds to execute this commands.

Greetings
Luciano

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Jul 18, 2005 5:30 pm

Not sure I'm understanding your question. What is it that you want to accomplish?

From a DOS prompt, if you type "ipconfig/all" you will get a listing of pertinent data regarding your network connection. If this is what you're looking for, you could call this from Macro Scheduler and write the info to a text file that could then be parsed to glean the data you need.

Something like this will put the info in a text file:

Run>cmd /c ipconfig/all > path\textfile.txt

Hope this helps,
Dick

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Jul 18, 2005 6:30 pm

If you want to look for a specific installed/loaded driver then how about something like:

Download and install drivers.exe from microsoft (only comes standard with server versions), confusingly the installer and program are both called drivers.exe but I found the program itself had installed to c\program files\resource kit. Works for me in w2k, haven't tested on XP.
http://www.microsoft.com/windows2000/te ... vers-o.asp

Run it from macrosheduler capturing the output to a file.

Search the file for the driver name.

User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

Post by tony_smith » Tue Jul 19, 2005 7:05 pm

With writing ipconfig output to a file... you can modify this little script I wrote to do the same sort of thing, but for a specific application...

Remark> This tests TPPC task queue to see if it is running, and if not, sends email.
Remark> This script is compiled into TEST-TASQ.exe and runs every 10 minutes through Windows Scheduled Tasks.
GetDate>Date
GetTime>Time
Remark>Hide the DOS window
Let>RP_WINDOWMODE=0
Del>U:\Reports\Temp\taskq.txt
Remark> pslist.exe is part of PStools
Run Program>Cmd /c pslist tppc >U:\Reports\Temp\taskq.txt
Wait>5
Let>x=0
Label>START
Let>x=x+1
ReadLn>U:\Reports\Temp\taskq.txt,x,LINE1
If>LINE1=,START
If>LINE1=##EOF##,EML
Position>Tppcsrvr,%LINE1%,1,LINPOS
//MessageModal>%LINPOS%
If>LINPOS=0,START

Label>EML
If>LINPOS=1,End

Label>SENDMAIL
//MessageModal>NOT THERE
Let>SENDMAIL_STATUS=0
Let>me=xxxxx@xxxx
Let>myname=EDI System Auto Message
Let>Subject=TPPC Task Queue Is Not Running
Let>body=TEST-TASKQ.scp %Date% %Time%%CRLF%TASK QUEUE IS NOT RUNNING

Remark>Read recipients from ini.file
ReadIniFile>U:\macros\INIFILES\email_add.ini,SYS_MSG,RECIP,RECIPTS
Let>recipients=%RECIPTS%
SMTPSendMail>recipients,exch.xxxx.local,me,myname,subject,body,
Let>RP_WINDOWMODE=1
Label>End

User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

Post by tony_smith » Tue Jul 19, 2005 7:25 pm

Oh... sorry... use netsh.exe and pipe the results, not ipconfig.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts