如何通过命令行访问共享文件夹

如何通过命令行访问共享文件夹

本文介绍了如何通过命令行访问共享文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows7命令行中建立并保存连接到我的工作网络共享文件夹?

How do I establish and save a connection in Windows7 command line to my work network shared folder?

推荐答案

net use p: \\servername\sharename /persistant:yes





其中p :是要映射到的驱动器号。



Where p: is the drive letter you want to map to.


net use X: \\192.168.1.X\sharename {password} /USER:username /P:yes





以上解释:



explanations of the above:

net use

是连接到本地驱动器的命令

is the command to connect to a local drive

X:

这可以是任意字母,后跟半冒号。只要正在运行批处理的机器没有使用此驱动器号!

this can be any letter followed by a semi colon. as long as the machine on which the batch is being run does not have this drive letter in use!

\\ip

这是服务器的静态IP或者可以是机器名称(windows机器名称)

this is the static ip of the server or can be the machine name(windows machine name)

\share-name

这是该位置的名称在服务器上共享。设置共享的用户将分配此名称

this is the name of the location being shared on the server machine. user who sets up sharing will assign this name

{password}

完整突出显示的术语(即包括大括号)是服务器机器的密码

the complete highlighted term (ie including the braces) is the password to the server machine

/USER:username

用户名由服务器机器的用户名替换。

the username is replaced by the user name of the server machine.

/P:yes

这意味着此连接是持久的。这将使客户端计算机处于打开状态的连接保持连接状态,并在重新启动时断开连接!



更多详细信息:

通过在VB.net中使用如下命令运行批处理文件

process.start(C:\ folder \ connect.bat)

应用程序加载事件

我们可以欺骗我们登录服务器并获取对数据库文件的访问权限。但是当然应该动态地跟踪数据库的路径。(我不会在这里讨论!)

this means that this connection is persistent. this will keep the connection live for the duration of which the client machine is on and will disconnect with a reboot!.

further details:
By having the batch file to run with a command such as this in VB.net
process.start("C:\folder\connect.bat")
on the event of application load
we can cheat our way of logging in to the server and gain access to the database file. but of course one should keep track of the path to the database dynamically.(i will not get into the ways here!)


这篇关于如何通过命令行访问共享文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 20:00