Make a share folder:?:

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
joakim
Posts: 24
Joined: 07 Mar 2012 12:08

Make a share folder:?:

#1 Post by joakim » 07 Jul 2012 03:57

Hi, ok now i have modded it a little bit =) but it still dosent work!! :roll:
plz help me :mrgreen:


@echo off
color 0A
title Folder Pro edi!
cls
echo ================================
echo Please Select an Drive to begin
echo ================================
echo.
echo.
echo Please wrigt down your drive (only the letter)
echo.
echo use BIG letter!
echo.
echo.
echo Example: C: D: E: :F :G etc...
echo.
set /p "Drive=>"
echo.
echo.
Pause
cls

:Home
cls
echo ===================================
echo = FOlder shere = "made by skillsa2=
echo ===================================
echo.
echo DRIVER SELECTED = %Drive%
echo.
echo 1. make a folder and shere it.
echo.
echo 2. Delete an folder.
echo.
echo.
set /p "cho=>"
if %cho%==1 goto 1A
if %cho%==2 goto 2A
if %cho%== echo wrong anser!


:1A
cls
echo Wright the name of the folder you want to create.
echo.
echo.
set /p "nam=>"
echo.
md %nam%
echo.
echo the folder %nam% has been created!
echo.
pause
cls
net share folder=%Drive%:\%nam%
pause


lol =)

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Make a share folder:?:

#2 Post by abc0502 » 07 Jul 2012 08:13

Hi Joakim, I modified your code hope you don't mind and added few options hope you like it
@echo off
Cls
Mode 70,20
Color 0A
Title Folder Pro edi!

:home1
cls
echo ========================
echo = Enter Drive Letter =
echo ========================
echo.&echo Enter Drive Name [ Dive letter only C, D, ... ]

Set /p "Drv=>"
Set "Drive=%Drv%[color=#FF0000]:
"
echo.&echo.
cls



:home2
cls
echo ===========================================
echo = Folder Share = " Made by skillsa2 " =
echo ===========================================
echo.&echo Selected Driver is: ^[ %Drive% ^]
echo.&echo ^<1^> Create A Folder and Share it.
echo.&echo ^<2^> Delete A Folder and Stop Sharing it.
echo.&echo ^<3^> Stop Sharing A Folder.
echo.&echo ^<4^> Change Drive
echo.&echo ^<5^> Exit
echo.&echo.
Set /p "cho=>"
If %cho%==1 goto 1A
If %cho%==2 goto 2A
If %cho%==3 goto 3A
If %cho%==4 goto goto home1
If %cho%==5 goto EOF


:1A
cls
echo ===========================================
echo = Folder Share = " Made by skillsa2 " =
echo ===========================================
echo.&echo Enter Folder Name:
Set /p "name=>"
Set "Fname=%name%"
echo.&echo Enter Shared Folder Name:
Set /p "name2=>"
Set "Sname=%name2%"
::check if the file exist or not
If EXIST "%Drive%\%Fname%" ( Echo Folder Exist, Please Choose Another name.
ping localhost -n 4 >nul
cls
goto 1A
)

MD "%Drive%\%Fname%"
echo.&echo Folder "%Fname%" Created Successfully.
echo.
echo Sharing Folder now ...
Net share %Sname%=%Drive%\%Fname%
ping localhost -n 5 >nul
goto home2

:2A
cls
echo ===========================================
echo = Folder Share = " Made by skillsa2 " =
echo ===========================================
echo.&echo Enter Drive Name:
Set /p "Drv2=>"
Set "Drive2=%Drv2%:"

echo.&echo Enter Folder Name:
set /p "name3=>"
Set "Fname2=%name3%"

echo.&echo Enter Shared Folder Name:
Set /p "name4=>"
Set "Sname2=%name4%"
cls
echo.
echo.&echo Selected Folder is: %Drive2%\%Fname2%
echo Shared Folder Name is: %Sname2%
echo.&echo Is That True? [ y / n ]
set /p "cho2=>"
if %cho2%==y goto next
if %cho2%==n goto :2A
:next
If Exist "%Drive2%\%Fname2%" ( RMDIR /S /Q "%Drive2%\%Fname2%"
) Else ( Echo Error &ping localhost -n 3 >nul &goto :2A )

ping localhost -n 3 >nul
echo Removing Shared Folder.
Net Share %Sname2% /delete

ping localhost -n 3 >nul
goto :home2



:3A
cls
echo ===========================================
echo = Folder Share = " Made by skillsa2 " =
echo ===========================================
echo.&echo Enter Shared Folder Name:
Set /p "name5=>"
Set "Sname3=%name5%"

echo Removing Shared Folder.
Net Share %Sname3% /delete

ping localhost -n 3 >nul
goto :home2


Post Reply