![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-02 11:37 |
48,038 topics / 350,123 posts / today 1 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] How can I use a batch file to implement this function??? (Brother lxmxn = it's you) |
| Printable Version 1,027 / 7 |
| Floor1 baepyygy | Posted 2006-11-22 22:25 |
| 初级用户 Posts 61 Credits 142 | |
|
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 Edit,at 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 clickhereto 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 ] |
|
| Floor2 baepyygy | Posted 2006-11-23 00:43 |
| 初级用户 Posts 61 Credits 142 | |
|
Does nobody know how??
|
|
| Floor3 lxmxn | Posted 2006-11-23 02:13 |
| 版主 Posts 4,938 Credits 11,386 | |
|
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... |
|
| Floor4 baepyygy | Posted 2006-11-23 02:55 |
| 初级用户 Posts 61 Credits 142 | |
|
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. |
|
| Floor5 lxmxn | Posted 2006-11-23 06:05 |
| 版主 Posts 4,938 Credits 11,386 | |
|
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). |
|
| Floor6 baepyygy | Posted 2006-11-23 06:37 |
| 初级用户 Posts 61 Credits 142 | |
|
The check is for remaining free space, and the server means another machine on the LAN!
|
|
| Floor7 lxmxn | Posted 2006-11-23 06:45 |
| 版主 Posts 4,938 Credits 11,386 | |
Originally posted by baepyygy at 2006-11-23 06:37: Then that's hard to check. BAT does not support UNC addresses. |
|
| Floor8 baepyygy | Posted 2006-11-23 07:07 |
| 初级用户 Posts 61 Credits 142 | |
|
....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!~ |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |