diskpart执行脚本出错

江南编程浪子 2014-11-20 10:57:35
我想让diskpart自动分区,但是每次执行出错,完全看不出什么错误,大家帮忙来看看问题

我的命令行:(环境:powershell和cmd都试过,一样的结果)

diskpart /s C:\diskpart.txt

----------------------------------------------------------------------------

diskpart.txt的内容:

select disk 0
select partition 1
extend size=10240
create partition extended
create partition logical size=10240
assign letter=E
FORMAT FS = NTFS QUICK
create partition logical size=3072
assign letter=p
FORMAT FS = NTFS QUICK
create partition logical
assign letter=y
FORMAT FS = NTFS QUICK


----------------------------------------------------------------------------
即便我将diskpart.txt删到只有第一行,还是出错

报错是给所有diskpart的命令提示,感觉是语法错误,无法理解我的命令

这是我命令操纵端:


PS C:\> diskpart /s C:\diskpart.txt

Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: AUTOHOSTNAME

Microsoft DiskPart version 6.1.7600

ACTIVE - Mark the selected partition as active.
ADD - Add a mirror to a simple volume.
ASSIGN - Assign a drive letter or mount point to the selected volume.
ATTRIBUTES - Manipulate volume or disk attributes.
ATTACH - Attaches a virtual disk file.
AUTOMOUNT - Enable and disable automatic mounting of basic volumes.
BREAK - Break a mirror set.
CLEAN - Clear the configuration information, or all information, off the
disk.
COMPACT - Attempts to reduce the physical size of the file.
CONVERT - Convert between different disk formats.
CREATE - Create a volume, partition or virtual disk.
DELETE - Delete an object.
DETAIL - Provide details about an object.
DETACH - Detaches a virtual disk file.
EXIT - Exit DiskPart.
EXTEND - Extend a volume.
EXPAND - Expands the maximum size available on a virtual disk.
FILESYSTEMS - Display current and supported file systems on the volume.
FORMAT - Format the volume or partition.
GPT - Assign attributes to the selected GPT partition.
HELP - Display a list of commands.
IMPORT - Import a disk group.
INACTIVE - Mark the selected partition as inactive.
LIST - Display a list of objects.
MERGE - Merges a child disk with its parents.
ONLINE - Online an object that is currently marked as offline.
OFFLINE - Offline an object that is currently marked as online.
RECOVER - Refreshes the state of all disks in the selected pack.
Attempts recovery on disks in the invalid pack, and
resynchronizes mirrored volumes and RAID5 volumes
that have stale plex or parity data.
REM - Does nothing. This is used to comment scripts.
REMOVE - Remove a drive letter or mount point assignment.
REPAIR - Repair a RAID-5 volume with a failed member.
RESCAN - Rescan the computer looking for disks and volumes.
RETAIN - Place a retained partition under a simple volume.
SAN - Display or set the SAN policy for the currently booted OS.
SELECT - Shift the focus to an object.
SETID - Change the partition type.
SHRINK - Reduce the size of the selected volume.
UNIQUEID - Displays or sets the GUID partition table (GPT) identifier or
master boot record (MBR) signature of a disk.
----------------------------------------------------------------------------

但是diskpart.txt里的命令一个个在diskpart里打进去运行时可以的,大家可以帮忙看看是什么问题吗?
...全文
457 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
江南编程浪子 2014-11-21
  • 打赏
  • 举报
回复
问题解决,将文本另存为ANSI就好了

6,868

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧