Hi Pajqk,
First problem I see here is the language. Since I wrote the script in English using an English language computer, and used some English text from the output of the ‘Net Use’ command to parse the output, it is resulting in some bad entries in your Polish(?) system. Easy fix. In the script there is a line:
IF NOT(Instr(Line,"New connect") OR Instr(Line,"Status") OR Instr(Line,"----") OR Instr(Line,"The command") OR Instr(Line,"There are") OR Len(Trim(Line)) = 0) THEN
Update this line with the Polish or other language equivalents as they appear in the ‘net use’ output so these lines are not considered as shares.
The other part of your problem is more difficult. Since ‘net use’ also does not list your shares properly and it is this output I am reading, the script also will not work. We can look to see if WMIC lists the drives correctly and adjust the script to read WMIC output instead of net use. Please try the following command on your system to see if it correctly lists the paths:
wmic logicaldisk where drivetype=4 get caption,providername
Steve McCormick, ITIL
CA Technologies
Principal Services Consultant
Stephen.McCormick@ca.com
<mailto:Stephen.McCormick@ca.com>