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?
What is the best way to map windows drives using golang?
3k Views Asked by witek At
1
There are 1 best solutions below
Related Questions in WINDOWS
- Get Maximum Log Size
- Debugging Windows Services while starting
- Possible consequences of duplicate ProgId for different classes
- How to chain BCryptEncrypt and BCryptDecrypt calls using AES in GCM mode?
- mingw-64 conflicting declarations when cross-compiling
- I run an EXE program from a Windows Service but I can't see form C#?
- Why is PowerShell "not recognized" when installing Chocolatey?
- How to check if Windows device is phone or tablet/pc?
- How to add directories to Cygwin gcc default search path
- Can't install anything with pip2 on Windows 7 due to UnicodeDecodeError
- Active directory and linux nslcd binding without extending the AD schema
- How To Prevent Over Scrolling in Scroll Viewer Windows Phone 8.1
- Unicode error from pip install
- Where is the 'EnablePinning' property in the ribbon framework's recent items?
- How can I implement the same models and data across ASP.NET and Windows Apps
Related Questions in GO
- How do I get all the attributes of an XML element using Go?
- Type cast custom types to base types
- Why are Revel optional func parameters in controller not working? CRUD code redundancy
- Streaming commands output progress
- single ampersand between 2 expressions
- golang goroutine use SSHAgent auth doesn't work well and throw some unexpect panic
- How do I do a literal *int64 in Go?
- Emulating `docker run` using the golang docker API
- How to print contents of channel without changing it
- Golang time zone parsing not returning the correct zone on ubuntu server
- Is os.File's Write() threadsafe?
- How to get the pointer of return value from function call?
- How do I represent an Optional String in Go?
- Fibonacci in Go using channels
- Boltdb-key-Value Data Store purely in Go
Related Questions in MAPPING
- Change lowercase and uppercase of characters in java
- Texture mapping consuming physical memory
- Looping functoid, Mapping
- is there a way to find all the perforce workspaces which are mapping a certain file in the depot?
- XSLT Mapping for replacing child nodes with new set under parent nodes
- Missing Foreign Keys when mapping Child Entities from JSON / How to generate them?
- How do I set up the relation using Fluent API between an Employee entity and an ICollection<Employee>?
- Mapping int to int (in Java)
- Add brands through company, it's possible? How?
- maven-rpm-plugin set folders permission differently from files when mapping
- Projecting a texture from plane to object with Unity
- how to extract characters of a language
- When I try to map the properties for an entity (Entity Framework), I get the error the type '__' must be a non-nullable value type
- Android + Dozer throws IllegalArgumentException
- (Using Spring)How to stop DTO from repeating when the map appears to be fine?
Related Questions in DRIVE
- Copy Row if Sheet1 A contains part of Sheet2 C
- Formatting a drive in Visual Basic?
- How to check whether the given path is network path or not in c#?
- Using the UIDocumentPickerViewController, is it possible to show a default service (Dropbox, Google Drive, etc) on first open like in Slack?
- Morring Matrix with Google Drive SpreadSheets
- Edit Specific Rows in Google Drive Spreadsheets
- What is the best way to map windows drives using golang?
- Is it possible to upload file on specific google drive in Android
- How can I get a list of removable drives plugged in the computer?
- Test a cell on a Google Sheet and write to that row
- Is there any ways to get drive information of each vmware in Vmware ESX via Vsphere SDK with Java?
- Windows DeviceIoContro() with IOCTL_DISK_GET_LENGTH_INFO takes realllllllly long
- get USB drive name over VBA on WinCE
- upload file to drive using google-drive-api and c#
- How to get fixed disk drive letters in three seperate text files using batch?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
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 /PQ:represents your windows drive,\\SERVER\SHAREis the network address,/user:Alice pa$$wordare your credentials, and/Pis for persistence.Executing this in Go would look something like: