How to check the shared drives can be connected

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
nodochau
Pro Scripter
Posts: 135
Joined: Wed Jan 16, 2019 12:59 pm

How to check the shared drives can be connected

Post by nodochau » Tue Oct 13, 2020 6:19 pm

Hello All,
I have scripts that get into files in my company shared drives to retrieve some info. But sometimes the network does not work so the scripts just keep waiting. Is there anyway to send a signal or time out to check that I can connect to the shared drive? if not it will perform something else.

Thanks

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1378
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: How to check the shared drives can be connected

Post by Dorian (MJT support) » Tue Oct 13, 2020 7:31 pm

Can you use GetFileList and perform one action if the file count is >0 and another if it isn't? Or is that too simplistic?

Code: Select all

GetFileList>c:\doesnotexist\*.*,files
Separate>files,;,file_names

If>%file_names_count%>0
  messagemodal>I found files
Else
  messagemodal>Nothing here
Endif
Yes, we have a Custom Scripting Service. Message me or go here

nodochau
Pro Scripter
Posts: 135
Joined: Wed Jan 16, 2019 12:59 pm

Re: How to check the shared drives can be connected

Post by nodochau » Wed Oct 14, 2020 10:46 am

Thanks Dorian. Just keep thinking about something likes httprequest but your solution is quite simple.
Just add waiting time and a loop to check the connection in 5 seconds then bingo.
Thanks a gain
:idea:

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