DosTips.com

A Forum all about DOS Batch
It is currently 27 Jul 2016 01:43

All times are UTC-06:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Show /Hide on Network
PostPosted: 03 Mar 2012 01:51 
Offline

Joined: 15 Feb 2011 10:32
Posts: 4
I have the script as follows:
Quote:
@echo off
goto main
:main
cls
echo 1 Show on Network
echo 2 Hide on Network
echo 3 Exit
:choice
set /P C=[1,2,3]?
if "%C%"=="1" goto showit
if "%C%"=="2" goto hideit
if "%C%"=="3" goto exitit
:showit
net config server /hidden:no
:hideit
net config server /hidden:yes
:exitit
exit

So it can work well? :D


Top
   
PostPosted: 03 Mar 2012 05:08 
Offline
Expert

Joined: 10 Feb 2012 02:20
Posts: 5810
I haven't tested this but there are some fixes below.

Code:
@echo off
goto :main
:main
cls
echo 1 Show on Network
echo 2 Hide on Network
echo 3 Exit
:choice
set "C="
set /P C=[1,2,3]?
if not defined c goto :choice
if "%C%"=="1" goto showit
if "%C%"=="2" goto hideit
if "%C%"=="3" goto exitit
goto :main
:showit
net config server /hidden:no
goto :EOF
:hideit
net config server /hidden:yes
goto :EOF
:exitit
exit
goto :EOF


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited