Jump to content

Recommended Posts

Posted

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.

Posted (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 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)

Posted

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!

My-Colors.jpg

cuniform2.gif

Posted

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

Posted

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!

My-Colors.jpg

cuniform2.gif

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...