China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 12:55
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How can I use a batch file to implement this function??? (Brother lxmxn = it's you) View 1,029 Replies 7
Original Poster Posted 2006-11-22 22:25 ·  中国 广东 深圳 电信
初级用户
★★
Credits 142
Posts 61
Joined 2006-06-01 19:41
20-year member
UID 56391
Gender Male
Status Offline
Implement this in the following code: when the free space on drive D of storage server X is less than 10GB, if the user still chooses server X for data storage, the program should first check whether drive D on server X is greater than 10GB. If yes, then continue. Otherwise, give the prompt “Server X disk space is full.” Then after pressing any key, the program should still continue running...

(As long as it achieves the purpose of a prompt!! ~~)

Sample code:
@echo off
color e
:start
cls
set /p ok=Please choose a storage server(1-5):
if %ok% geq 1 (
if %ok% leq 5 (
if exist GameSave%ok% (Start GameSave%ok%\svClient.exe) else (goto wrong)
) else (goto wrong)
) else (goto wrong)
goto :eof

:wrong
echo Server does not exist
echo Press any key to continue
>nul pause
goto start


──────────────── Moderator Record ────────────────
Handled by: namejm
Original title: Help: How can this function be implemented with a batch file??? (Brother lxmxn = that's you)
Explanation: Because the title is too vague, it is inconvenient for forum searching and management. Please modify the title within three days.
Tip: To modify the title, click
Editat the lower right of the current post. After finishing the modification, press Edit Post .
Penalty: Since you only recently got past the newbie stage, no penalty will be given for now; if it is still not modified after three days, the following will be deducted:
  2 credits as a penalty, and the moderator will forcibly modify the title. Please click
hereto read the forum posting rules,
  to avoid violating the posting rules in future discussions.
──────────────── Moderator Record ────────────────


[ Last edited by namejm on 2006-11-22 at 05:48 PM ]
Floor 2 Posted 2006-11-23 00:43 ·  中国 广东 深圳 电信
初级用户
★★
Credits 142
Posts 61
Joined 2006-06-01 19:41
20-year member
UID 56391
Gender Male
Status Offline
Does nobody know how??
Floor 3 Posted 2006-11-23 02:13 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Please explain your question clearly. What system is your server running, and what file system is drive D using? Also explain your goal clearly, hehe...
Floor 4 Posted 2006-11-23 02:55 ·  中国 广东 深圳 电信
初级用户
★★
Credits 142
Posts 61
Joined 2006-06-01 19:41
20-year member
UID 56391
Gender Male
Status Offline
My system is Win2003, all in NTFS format.... still this multi-choice program, add in a check of the free space on the disk where GameSave is located on the storage server. When the space is smaller than the specified size, it should display the prompt “The server disk space is full”, and after pressing Enter the program continues running..... on a LAN...

Not sure if that was clear enough.
Floor 5 Posted 2006-11-23 06:05 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Sorry, I don't have a Windows 2003 environment, so it's hard for me to write the code. Also, for checking disk space, I don't know whether you mean checking the total size or the remaining available free space, and I also don't know whether by server you mean the local machine or another machine on the LAN (that is, accessing it).
Floor 6 Posted 2006-11-23 06:37 ·  中国 广东 深圳 电信
初级用户
★★
Credits 142
Posts 61
Joined 2006-06-01 19:41
20-year member
UID 56391
Gender Male
Status Offline
The check is for remaining free space, and the server means another machine on the LAN!
Floor 7 Posted 2006-11-23 06:45 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Originally posted by baepyygy at 2006-11-23 06:37:
The check is for remaining free space, and the server means another machine on the LAN!


  Then that's hard to check. BAT does not support UNC addresses.
Floor 8 Posted 2006-11-23 07:07 ·  中国 广东 深圳 电信
初级用户
★★
Credits 142
Posts 61
Joined 2006-06-01 19:41
20-year member
UID 56391
Gender Male
Status Offline
....Sure enough, just like I thought.........................but thanks anyway!!~~

There's another new question, I posted it, please take a look.. how can it be implemented!~
Forum Jump: