pvr02 0 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. Share this post Link to post Share on other sites
JSThePatriot 18 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 LinksFile-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.ComputerGetInfo UDF's Updated! 11-23-2006External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Share this post Link to post Share on other sites
Fossil Rock 2 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! Share this post Link to post Share on other sites
pvr02 0 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 Share this post Link to post Share on other sites
NELyon 2 Posted August 7, 2006 try the _RunDOS command (It's a UDF) Share this post Link to post Share on other sites
Fossil Rock 2 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! Share this post Link to post Share on other sites