Guest Posted August 3, 2006 Share Posted August 3, 2006 We have a couple of virtual drives that users place data in. However we are unable to access them via an admin share since they are virtual. How would I go about creating a script that the user can double click to create an admin share? I know the command in DOS is: net share <sharename>$=<driveletter>:\ but i'm not sure how to execute that in a script. Thanks in advance. Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 3, 2006 Share Posted August 3, 2006 (edited) Should be something along the lines of... $sharename = "Some Name" $driveletter = "x" Run(@ComSpec & " /c net share '" & $sharename & "'$=" & $driveletter & ":\") You should be able to have spaces in the share name as I have shown above. If it doesnt allow spaces then please let me know. I am not able to test the above code, but I do believe it should work. Edit 01: added space before /c. I forgot about that. Thanks, JS Edited August 3, 2006 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Fossil Rock Posted August 3, 2006 Share Posted August 3, 2006 Virtual drives can be shared just like any other drive ..... Do you have rights to view the share? Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Guest Posted August 7, 2006 Share Posted August 7, 2006 I tried using the following but it didn't work. I'm not sure of the message that i'm getting since the cmd prompt closes to fast. $sharename = "W$" $driveletter = "W" Run(@ComSpec & " /c net share '" & $sharename & "'$=" & $driveletter & ":\") Any help would be appreciated Link to comment Share on other sites More sharing options...
NELyon Posted August 7, 2006 Share Posted August 7, 2006 try the _RunDOS command (It's a UDF) Link to comment Share on other sites More sharing options...
Fossil Rock Posted August 7, 2006 Share Posted August 7, 2006 I tried using the following but it didn't work. I'm not sure of the message that i'm getting since the cmd prompt closes to fast. $sharename = "W$" $driveletter = "W" Run(@ComSpec & " /c net share '" & $sharename & "'$=" & $driveletter & ":\")oÝ÷ Ø òéiÂ¥u·¦Þr&yßêº^jëh×6$sharename = "W$" $driveletter = "W" Run(@ComSpec & " /k net share '" & $sharename & "'$=" & $driveletter & ":\") Change /c to /k and the box will remain open. Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now