flat assembler
Message board for the users of flat assembler.

Index > Windows > Windows API to attach, remove network shared drive

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 13199
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 01 Mar 2018, 18:29
i need some cheap man solution,
basically, a simple interface that allow people to key in their secret passphrase, then the program will map his or her shared drive to windows Z drive,

the environment having several kinds of windows os, 7 home, xp, 7 pro, 8 and 10,

any suggestions?
Post 01 Mar 2018, 18:29
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 321
donn 01 Mar 2018, 19:15
Probably this, which works since Win 2000.

If you need something more manual, maybe
Code:
net use z: \servername\sharedfolder /persistent:yes    
. The WINAPI func would be neat to implement, but prob won't have time myself to try.

References:
https://stackoverflow.com/questions/182750/map-a-network-drive-to-be-used-by-a-service
https://stackoverflow.com/questions/20883224/using-windows-net-use-command-from-java-with-win32-api

Good luck.
Post 01 Mar 2018, 19:15
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 01 Mar 2018, 22:10
sleepsleep wrote:
i need some cheap man solution,
basically, a simple interface that allow people to key in their secret passphrase, then the program will map his or her shared drive to windows Z drive,

the environment having several kinds of windows os, 7 home, xp, 7 pro, 8 and 10,

any suggestions?

Just curious. What is the purpose of this? I mean, if connection is possible by means of some generic function, what would prevent anyone from calling it themselves without the need to run the program that asks for password?
Post 01 Mar 2018, 22:10
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13199
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 02 Mar 2018, 17:15
i need drive mapping with user password authentication that not based on Windows users, it should works in non professional edition windows os,

if it possible to create virtual users to connect password protected shared drive? idk, basically that is what i intended to solve, hopefully with volume size controlled,

so users log on Windows as usual, run my program, input password, then his/her shared drive will get mapped,

when log out, or exit windows, the shared drive will be unmapped,

is there any solution like this already, so i don't have to reinvent the wheel,
Post 02 Mar 2018, 17:15
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13199
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 02 Mar 2018, 21:35
after some google, maybe a webdav is better solution?
Post 02 Mar 2018, 21:35
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 321
donn 02 Mar 2018, 23:38
Net use, net share, and disk part should cover what you need in the shortest amount of time. You can then wrap the commands or .bat file in a win app to provide a frontend or if you have enough time go straight to the winapi.

Ive uaed these a lot successfully for disk provisioning in virtualized environments along with psexec for remote access.
Post 02 Mar 2018, 23:38
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.