Share entire drive(s)

Discuss and share scripts and script files...
Post Reply
yusef88
Posts: 1123
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Share entire drive(s)

Post by yusef88 »

if you need to share all drives with one click,didn't find program do that but I managed to achieve this by XYplorer

Code: Select all

"Share Hard Drive"
    msg "Share entire hard drive ?<br>test=read & %username%=full" , 1;
   $d=get("drives");
   $d=replace("$d", "\", "");
// returns Drive strings (C:, D:, E:):
 foreach($token, "$d", "|") {
    $n=replace("$token", ":", ""); //drive valid name
    runret ("net share ""$n""=""$token"" /GRANT:%username%,FULL /GRANT:test,Read /remark:""%username%,test""")
 }
delete hard disk share

Code: Select all

"Delete Hard Drive Share"
   msg "Delete Share Hard drive?" , 1;
   $d=get("drives");
   $d=replace("$d", "\", "");
// returns Drive strings (C:, D:, E:):
 foreach($token, "$d", "|") {
    $n=replace("$token", ":", "");
    runret ("net share ""$n"" /delete")
 }

Post Reply