So I am trying to create a batch file that will do different things depending on the output of another program. Basically, the first program outputs some information on the encryption status of the hard drive. Here is the output when a drive is not encrypted
S:>beinvvol.exe xlc
------------------------------------------------------------------------
BEInvVol, Utimaco Safeware AG - A member of the Sophos Group
Decommissioning Tool for fully SGN-encrypted Volumes
------------------------------------------------------------------------
&Info: SGN filter driver off
&Info: Target log-file "S:BEInvVol.log"
------------------------------------------------------------------------
Listing info for the target volume(s) -command xlc
Date: 2011-07-26 13:31:01
[Volume C:]
Drive Type: DRIVE_FIXED
[Boot Sector]
Media Type: Plain -not SGN
Media Label:
Media Serial Number: {8C19-DCCD}
File System: NTFS
Size: 232.88 GB
这里是你在驾车被加密时得到的东西。
S:>beinvvol.exe xle
------------------------------------------------------------------------
BEInvVol, Utimaco Safeware AG - A member of the Sophos Group
Decommissioning Tool for fully SGN-encrypted Volumes
------------------------------------------------------------------------
&Info: SGN filter driver off
&Info: Target log-file "S:KeyDestroyBEInvVol.log"
------------------------------------------------------------------------
Listing info for the target volume(s) -command xle
Date: 2011-07-26 12:41:48
[Volume E:]
Drive Type: DRIVE_FIXED
[Boot Sector]
Media Type: SGN -fully encrypted
SGN Media GUID: {83490018-50C3-B4E3-829E-ACE3B23C86D3}
File System: NTFS
Size: 298.09 GB
[KSA Original]
Sector Offset ..... 0x0000000000065ED8 (417496)
Byte Offset ....... 0x000000000CBDB000 (213757952)
Size in Sectors ... 0x15 (21)
Size in Bytes ..... 0x2A00 (10752)
[KSA Backup]
Sector Offset ..... 0x000000002542D660 (625137248)
Byte Offset ....... 0x0000004A85ACC000 (320070270976)
Size in Sectors ... 0x15 (21)
Size in Bytes ..... 0x2A00 (10752)
“xlc”和“xle”论点是选择驱动力。 因此,我认为,在无加密的驱动力中,“媒体类型:”我有“Plain-not SGN”和加密驾驶人,我有“SGN - 完全加密”
现在,我试图写上“Plain-not SGN”的表格/表格,然后把它交给档案的不同部分。 这里是我迄今为止的施稿:
@ECHO OFF
::Determine if drive is encrypted
FOR /F "tokens=3,4,5 delims= " %%A IN ( S:einvvol.exe xlc ) DO IF /I "%%A%%B%%C"=="Plain-notSGN" GOTO NOTENCRYPTED
:ENCRYPTED
ECHO Yes
GOTO END
:NOTENCRYPTED
ECHO No
:END
现在,我的想法是,把名单中的第3、第4和第5条标注(关于I m有兴趣,第1号标注为“Media”,第2条是“Type:”,第3、第4和第5条要么是“Plain”“not”和“SGN”或“SGN”“-ful”“encodeed”,然后看这些指示是否等于“Plain-notSGN”(调整所有这些指示)。 然而,这并不奏效。 任何建议?