广州浪奇官网,金范快乐大本营,农家药膳师风间云漪
我提供的脚本只是案例展示,真实场景需要自行修改。(正好我今天看到一个规范的bat脚本,我放出来,大家一起学习下)
要求:将20g的磁盘1,分出4g为主分区,4g扩展分区(2个2g逻辑分区)
试验环境:
1.主机与其他多台计算都可以建立$ipc连接,主机上共享disk目录,其中放有:
2.在客户端运行master.bat脚本,可用其他脚本或者远程调用
脚本:
disk1config.txt
rem seletct disk1 select disk 1 list partition rem clean disk1 clean list partition rem create the primary partition on the disk and assign the drive letter. create partition primary size=4096 assign letter=s format fs=ntfs label="primary" list partition rem create extended partition with 2 logical divers create partition extended size=4096 list partition rem 1 logical create partition logical size=2048 assign letter=u format fs=ntfs label="extended1" list partition rem 2 logical create partition logical size=2047 assign letter=v format fs=ntfs label="extended2" list partition
master.bat
@echo off if not "%os%"=="windows_nt" goto end if "%1"=="" (set info=echo && set sexit=1) else (set info=rem && set sexit=0) %info% ******************************* %info% script:disk1setup.bat %info% creation date : 2019/3/1 21:52 %info% last modified : 2019/3/1 21:53 %info% author: feiquan %info% email: 2283320260@qq.com %info% ********************************* %info% description: %info% configures the standard partitions on workstations %info% with a third hard drive.the script is configured so %info% that is will only run if you pass in a parameter %info% safeguard to help prevent accidental foamtting %info% of disks %info% ********************************* %info% examples: %info% master.bat ===^> show infomation %info% master.bat anychar ===^> create disk partition %info% ********************************* if "%sexit%"=="1" goto end @title "configuring disk 1..." rem cls color 07 rem connect $ipc net use h: \\remote-computer\sharefile rem sharefile diskpart /s h:\disk\disk1config.txt :end echo exiting.......
运行结果:
master.bat
master.bat anychar
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
新补丁让Windows 10出现死机、卡顿等 微软坐不住称正解决
Ubuntu 20.04 LTS进驻Windows子系统:只能用3年
ThinkPad正式加入:预装Linux发行版而非Win10的PC越来越多了
最新版Android 11推送!谷歌Pixel 5被曝光:支持反向充电
高度致敬Windows!开源优麒麟20.04 LTS发布:支持5年
电脑小知识:Windows 10是用什么语言写的?到底有多少行代码?
Win10 5月更新准正式版:微软引入大量新功能 系统响应速度快
Windows 10新预览版19613推送:修复任务栏图标显示异常BUG
Windows AD 报错解决:UAC File Virtualization服务启动失败 此驱动程序被阻止加载
网友评论