Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work with Windows 10 Pro machines. #9

Closed
cfayette opened this issue Feb 7, 2019 · 17 comments
Closed

Doesn't seem to work with Windows 10 Pro machines. #9

cfayette opened this issue Feb 7, 2019 · 17 comments
Labels

Comments

@cfayette
Copy link

cfayette commented Feb 7, 2019

First, of all, Andreas, thanks for writing a very cool script. I have one of my test machines is running MySQL and I have a dedicated drive mapping to it, as well as to other server machines. The server machines map just fine with this script, however the W10Pro machine does not and generates a 41301 error. I'm mapping the drives from my Windows 10 Pro for Workstations machine. Here, is a pic of the dialog box generated...

image

Here are some of the configs I've tried:
rem Set srvCfg2 = createUncSrvConfig("mv-mysql", Array("C"), Array("W:"), "yes", "mv-mysql\chris", "xxx")
rem Set srvCfg2 = createUncSrvConfig("198.168.1.162", Array("C"), Array("W:"), "yes", "", "")

Any ideas? Thanks...Chris

@thexmanxyz
Copy link
Owner

thexmanxyz commented Feb 7, 2019

@cfayette First and foremost I really appreciate your words! The script is on my side exclusively running under Windows 10 Pro (tested all versions since 1709). So the issue is probably not the Windows edition you run it on. Concerning the 41301 error, I don't know what error this is but by a short search I found this. Please confirm if this is the error you are facing, but I assume it is. This might happen because the script still runs as the reconnect didn't happen (198.168.1.162 not reachable). This would go away as soon as the failed attempt threshold is reached.

The screenshot you attached tells me that your machine 198.168.1.162 is not reachable for some reason. Do I understand right that the mapping does work on other drives/machines but just failed with 198.168.1.162? But I think I'm already seeing the issue. Am I right that you want your remote computers (MySQL machine) C drive to be mapped on W:? In that case you have to specify the line as follows:

Set srvCfg2 = createUncSrvConfig("198.168.1.162", Array("c$"), Array("W:"), "yes", "", "")

The dollar sign $ is crucial for the mapping - called administrative share. Also you have to make sure that you can manually establish a drive share to the administrative share because as far as I know out of the box this doesn't work with a Win 10 Pro machine (as the source of the drive) because it is limited by some security policies. I'm also not sure if you used the right subnet are you really using 198.168.x.x? This might also be the source of the problem - I just noticed it ;). Let me know if this solved it for you.

@cfayette
Copy link
Author

cfayette commented Feb 7, 2019 via email

@thexmanxyz
Copy link
Owner

thexmanxyz commented Feb 7, 2019

@cfayette It will take me a bit to read everything through but in the meanwhile can you please send me again the whole mail directly to [email protected] because I see there are images included which aren't correctly added to the issue comment and in the Github mail I received. That would make it a lot easier for me while investigating the problem. Thanks in advance.

@thexmanxyz
Copy link
Owner

thexmanxyz commented Feb 7, 2019

@cfayette And as an addition. You don't have to create two configurations for one machine like

Set srvCfg1 = createUncSrvConfig("tmad-pet130", Array("C", "E"), Array("U:", "V:"), "yes", "", "") ' 
Set srvCfg3 = createUncSrvConfig("tmad-pet130", Array("backup", "PET130-4TB-bkp"), Array("X:", "Z:"), "yes", "", "")

you can combine them into one configuration like this:

Set srvCfg1 = createUncSrvConfig("tmad-pet130", Array("C", "E", "backup", "PET130-4TB-bkp"), Array("U:", "V:", "X:", "Z:"), "yes", "", "")

It is not mandatory to combine them into one config, however it is more performant for the script to do so. This is not limited to any amount of shares and drives per config, you can use as many as you want. It is just limited to one config per machine. So the host tmad-pet130 works fine and just the host 198.168.1.162 respectively mv-mysql doesn't work with the script, just to be sure?

@thexmanxyz
Copy link
Owner

thexmanxyz commented Feb 7, 2019

@cfayette What you can additionally try is to check what the output of the net use command of the script is. As you also tried it manually with net use there can just be a small issue with the configuration or maybe a bug in the script but we will soon see. The script uses the net use the same way as you would normally do via the command line. Therefore I suggest to let the script output the net use command it generates and uses to connect the network share. To output every net use command executed by the script use the following line:

MsgBox(getNetUseCmd(srvConfig, j))

Simply add this line to L519 directly above If ctn = 0 Then this should give us a hint what the problem is and what the difference is between your manual command and the command generated by the script.

It should then look something like that:

MsgBox(getNetUseCmd(srvConfig, j))
If ctn = 0 Then

@cfayette
Copy link
Author

cfayette commented Feb 7, 2019

@cfayette It will take me a bit to read everything through but in the meanwhile can you please send me again the whole mail directly to [email protected] because I see there are images included which aren't correctly added to the issue comment and in the Github mail I received. That would make it a lot easier for me while investigating the problem. Thanks in advance.

Sorry about that - it was just an image of the error msg.
msgbox

@cfayette cfayette closed this as completed Feb 7, 2019
@cfayette
Copy link
Author

cfayette commented Feb 7, 2019

@cfayette And as an addition. You don't have to create two configurations for one machine like

Set srvCfg1 = createUncSrvConfig("tmad-pet130", Array("C", "E"), Array("U:", "V:"), "yes", "", "") ' 
Set srvCfg3 = createUncSrvConfig("tmad-pet130", Array("backup", "PET130-4TB-bkp"), Array("X:", "Z:"), "yes", "", "")

you can combine them into one configuration like this:

Set srvCfg1 = createUncSrvConfig("tmad-pet130", Array("C", "E", "backup", "PET130-4TB-bkp"), Array("U:", "V:", "X:", "Z:"), "yes", "", "")

It is not mandatory to combine them into one config, however it is more performant for the script to do so. So the host tmad-pet130 works fine? This is not limited to any amount of shares and drives per config, you can use as many as you want. It is just limited to one config per machine. So just the host 198.168.1.162 respectively mv-mysql doesn't work with script, just to be sure?

That's good to hear and I will make the change to all four in just one statement.

Yes, just the host and the 'mv-mysql' doesn't work with the script.

@thexmanxyz thexmanxyz reopened this Feb 7, 2019
@cfayette
Copy link
Author

cfayette commented Feb 7, 2019

@cfayette What you can additionally try is to check what the output of the net use command of the script is. As you also tried it manually with net use there can just be a small issue with the configuration or maybe a bug in the script but we will soon see. The script uses the net use the same way as you would normally do via the command line. Therefore I suggest to let the script output the net use command it generates and uses to connect the network share. To output every net use command executed by the script use the following line:

MsgBox(getNetUseCmd(srvConfig, j))

Simply add this line to L519 directly above If ctn = 0 Then this should give us a hint what the problem is and what the difference is between your manual command and the command generated by the script.

It should then look something like that:

MsgBox(getNetUseCmd(srvConfig, j))
If ctn = 0 Then

Ok, I added the msgbox code for the net use. All of the mappings showed just fine, except for the 'mv-mysql' one. It didn't show the msgbox, just displayed the "finished" msgbox showing the connection server as being "offline".
msgboxall

@thexmanxyz
Copy link
Owner

thexmanxyz commented Feb 7, 2019

@cfayette Ok this is what I already assumed. Your device mv-mysql is probably not allowing ICMP ping. That helped a lot.

@thexmanxyz
Copy link
Owner

@cfayette Try if you can ping your device both with ip and hostname. I assume this won't work. If this works I will have to take a deeper investigation or provide you with a modified version of the script to test without ping. Maybe I have to modify the script to include another configuration option.

@cfayette
Copy link
Author

cfayette commented Feb 7, 2019

That's it! Neither the IP address, nor the host name will allow ping. I've got to go for now, but I'll open up ICMP on that machine, tomorrow morning and try it all again. Thanks, again for such a cool script!

@thexmanxyz
Copy link
Owner

thexmanxyz commented Feb 7, 2019

@cfayette Take your time and don't worry. Just let me know when you've tested so that I know it is fixed.

Additionally, I release a new version - v1.3.8 is out now. I added a new script parameter called pingEnabled and updated the README to point on this issue. With this parameter it is now possible to globally disable all script ping execution. This is especially useful when you don't want to change the firewall rules or have no control over the server that doesn't support ping.

However it is still advised to keep the script ping enabled if you can modify the server configuration because if I remember right net use is terrible slow when the share / machine isn't reachable. Therefore I also integrated the ping checks in the first place because they can be easily cancelled after a timeout, which isn't possible for net use.

I really appreciate your words, patience and help on improving the project. Thanks.

PS.: sorry on that administrative share thing but it is often a bit hard to know what the intention is when just seeing the parameters of the script so I'm just iterating over the most likely causes of a connection issue by probability :).

@cfayette
Copy link
Author

cfayette commented Feb 8, 2019 via email

@cfayette
Copy link
Author

cfayette commented Feb 8, 2019 via email

@cfayette cfayette closed this as completed Feb 8, 2019
@thexmanxyz
Copy link
Owner

thexmanxyz commented Feb 12, 2019

@cfayette Sorry for my late answer but as it wasn't that urgent I took my time :). I assume everything works now?

No problem. Don't worry, if there is a useful feature which isn't that much work to implement and also provides some benefit for other people it's definitively worth it. There are still bigger requirements left open which I currently don't have the time for (configuration application, auto install, ...).

It might also be useful to transfer the whole project into another more sophisticated solution (tray app) which allows to manage network machines and their shares at one spot. However, for this project I initially decided to make it more simple with a VB script to get familiar with the language and as it is comfortable to use across many Windows versions without the need to install any sort of runtime. Basically just the script is mandatory.

Every input is great because it helps to improve the functionality / code and also reveals usage scenarios and problems which I didn't consider in the first place ;). But I'm really glad that you found a solution for your needs and that the script helps you. I created the script because I was really pissed by the Windows default behaviour and there is not really a good alternative solution available which also works fast. Most solutions are slow if you have multiple drives from different machines, e.g. if one is offline. You will run into terrible long timeouts which completely kills the actual benefit. The main objective was to guarantee that the reconnect happens as fast as possible and doesn't get blocked too long by timeouts of machines / drives.

The Task Scheduler is a great tool especially to hook on specific OS events. It's definitively worth a look because many things can be automatised with it and are kept hidden in the background. Great that I peaked your interest because it is really useful for many things. Well then you are already quite long around and experienced. I used NT but my knowledge and experience back then was quite tiny. Many people don't even know that there is something like an administrative share :D.

You are very welcome, if you have any further questions, feel free to open another issue!

@cfayette
Copy link
Author

cfayette commented Feb 13, 2019 via email

@thexmanxyz
Copy link
Owner

@cfayette You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants