What is the best way to map a network share to a windows drive using go-lang? This share also requires a username and password. A similar question was asked for python What is the best way to map windows drives using Python?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- Golang mongodb aggregation
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Can I run a single test in a suite?
- Warning : HTML 1300 Navigation occured?
- How to check if a request was cancelled
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- Is it possible to implement an interface with unex
As of now there is no direct way to do that in Go; I would recommend using
net use
, which of course limits the functionality to Windows, but that's actually what you need.So, when you open a command prompt in Windows you can map network shares to Windows drives by using:
net use Q: \\SERVER\SHARE /user:Alice pa$$word /P
Q:
represents your windows drive,\\SERVER\SHARE
is the network address,/user:Alice pa$$word
are your credentials, and/P
is for persistence.Executing this in Go would look something like: