Batch File for Sharing

Hamza Amin

Reputable
May 29, 2014
10
0
4,510
So what I want to do is share a folder from one laptop and then access it through the other laptop connected through a LAN wire. The accessing should be done through a batch file in the sense that it should open the shared folder for me.
Since I don't have two laptops or a PC. What I did was wrote a batch file that does the following

md Hello
net share Helloshare=C:\Hello
net use X: \\192.1*.1*.1\Helloshare /User:"H* B* A*" (password) /PERSISTENT:YES
start X:

pause

Now do you think If I had accessed it through a different laptop it would have worked? Because it works fine for me accessing it on the same laptop but like I said I don't have two computers to verify that it will work in that case. If you see any problem then do tell me.
 
Solution
If it runs on your local laptop, as long as you setup the share correctly on the other system, it will work. In the user field, you need to put in the computer name the user account is located on before the user name like this: /user:pCName\UserName
If it runs on your local laptop, as long as you setup the share correctly on the other system, it will work. In the user field, you need to put in the computer name the user account is located on before the user name like this: /user:pCName\UserName
 
Solution