\r\n\r\n

知っておきたいWindowsの基本的なcmdコマンド

コマンドプロンプトの薄暗いインターフェイスは、高度なWindowsツールへの入り口です。それらにアクセスするための基本的なcmdコマンドを紹介します...

多くの人にとって、コマンドプロンプトはWindowsオペレーティングシステムを彩る、どこか恐ろしい存在です。インターフェースは黒くてくすんでいて、あまり役に立ちません。Windowsの他のインターフェイスに比べると、空虚な印象を受けます。コマンドプロンプトは、その第一印象はあまり良くないものの、Windowsの中で最も強力なツールの一つです。

複雑な自動化からネットワーク設定まで、コマンドプロンプトは便利です。インターフェイスの不足は、それを補って余りある効果を持っています。コマンドプロンプトを使いこなせるようになるには、何から始めたらいいかわからないという方におすすめです。

cmdコマンド

ほとんどの人は、すぐに最適で最も便利なコマンドを探しますが、さまざまなパラメータの意味を隠しておくと便利です。コマンドプロンプトを使いこなすには、コマンドの辞書だけでなく、各パラメータの意味や、異なるパラメータをどのように組み合わせれば目的の効果を得られるかを理解することが必要です。

以下は、典型的なWindowsのコマンドで使用されるほとんどのコマンドの包括的なリストです。PDF版はこちらからダウンロードできます。下の基本コマンド一覧にスクロールすると、すぐに使えるコマンド一覧が表示されます。

a - b

ASSOC - Displays or modifies file extension associati***. ATTRIB - Displays or changes file attributes. BREAK - Sets or clears extended CTRL+C checking. BCDBOOT - Used to copy critical files to the system partition and to crate a new system BCD store. BCDEDIT - Sets properties in boot database to control boot loading.

グレードc

CACLS - Shows or changes access control lists (ACLs) of files. CALL - Calls a batch program from another. CD - Shows the name of or changes to a current directory. CHCP - Displays or sets the active code page number. CHDIR - Displays the name of or changes to the current directory. CHKDSK - Checks a disk and displays a status report. CHKNTFS - Displays or modifies the checking of disk at boot time. CHOICE - Batch file command that allows users to select from a set of opti***. CIPHER - Displays or alters the encryption of directories (files) on NTFS partiti***. CLIP - Redirects output off another command to the Windows clipboard. CLS - Clears the screen. CMD - Starts a new instance of the Windows command interpreter. CMDKEY - Creates, lists, and deletes stored user names and passwords or credentials. COLOR - Sets the default c***ole colors. COMP - Compares the contents of two files or sets of files byte-by-byte. COMPACT - Displays or alters the compression of files on NTSF partiti***. CONVERT - Converts FAT volumes to NTFS. You cannot convert the current drive. COPY - Copies one of more files to another location.

グレードd

DATE - Displays or sets the date. DEFRAG - Disk defragment accessory. DEL - Deletes one or more files. DIR - Displays a list of files and sub-directories in a directory. DISKCOMP - Compares the contents of two floppy disks. DISKCOPY - Copies the contents of one floppy disk to another. DISKPART - Displays or configures Disk Partition properties. DOSKEY - Edits command lines, recalls Windows commands, and creates macros. DRIVERQUERY - Displays current device driver status and properties.

電子

ECHO - Displays messages, or turns commands echoing on or off. ENDLOCAL - Ends localization of environment changes in a batch file. ERASE - Deletes one of more files. EXIT - Quits and closes the command shell. EXPAND - Expands compressed files.

グレード f

FC - Compares two files or sets of files, and displays the differences between them. FIND - Searches for a text string in a file or files. FINDSTR - Searches for strings in files. FOR - Runs a specified command for each item in a set. FORFILES - Selects files in a folder for batch processing. FORMAT - Formats a disc for use with Windows. FSUTIL - Displays or configures the file system properties. FTYPE - Displays or modifies file types used in file extensi*** associati***.

g - I

GOTO - Directs the Windows command interpreter to a labeled line in a batch program. GPRESULT - Displays Group Policy Information for machine or user. GRAFTABL - Enables Windows to display an extended character set in graphics mode. HELP - Provides help information for Windows commands. ICACLS - Display, modify, backup, or restore ACLs for files and directories. IF - Performs conditional processing in batch programs. IPCONFIG - Displays all current TCP/IP network configuration values.

タイプl-m

LABEL - Creates, changes, or deletes the volume label of a disk. MD - Creates a directory. MKDIR - Creates a directory. MKLINK - Creates Symbolic Links and Hard Links. MODE - Configures a system device. MORE - Displays output one screen at a time. MOVE - Moves one or more files from one directory to another directory.

O-Pタイプ

OPENFILES - Queries, displays, or disconnects open files or files opened by network users. PATH - Displays or sets a search path for executable files. PAUSE - Suspends processing of a batch file. POPD - Restores the previous value of the current directory saved by PUSHD. PRINT - Prints a text file. PROMPT - Changes the Windows command prompt. PUSHD - Saves the current directory then changes it.

RD - Removes a directory. RECOVER - Recovers readable information from a bad or defective disk. REM - Designates comments (remarks) in batch files. REN - Renames a file or files. RENAME - Renames a file or files. REPLACE - Replaces files. RMDIR - Removes a directory. ROBOCOPY - Advanced utility to copy files and directory trees.

サイズS

SET - Displays, sets, or removes environment variables for current session. SETLOCAL - Begins localization of environment changes in a batch file. SETX - Sets environment variables. SC - Displays or configures services (background processes). SCHTASKS - Schedules commands and programs to run on a computer. SHIFT - Shifts the position of replaceable parameters in batch files. SHUTDOWN - Allows proper local or remote shutdown of machine. SORT - Sorts input. START - Starts a separate window to run a specified programs or command. SUBST - Associates a path with a drive letter. SYSTEMINFO - Displays machine specific properties and configuration.

T字型

TAKEOWN - Allows an administrator to take ownership of a file. TASKLIST - Displays all currently running tasks including services. TASKKILL - Kill running process or applicati***. TIME - Displays or sets the system time. TIMEOUT - Pauses the command processor for the specified number of seconds. TITLE - Sets the window title for a CMD.EXE session. TREE - Graphically displays the directory structure of a drove or path. TYPE - Displays the contents of a text file.

タイプv-x

VER - Displays the Windows version. VERIFY - Tells Windows whether or verify that your files are written correctly to a disk. VOL - Displays a disk volume label and serial number. VSSADMIN - Volume Shadow Copy Service administration tool. WHERE - Displays the locati*** of files that match a search pattern. WMIC - Displays WMI information inside interactive command shell. XCOPY - Copies files and directory trees.

注:コマンドプロンプトに完全にアクセスするには、管理者としてプロンプトを実行する必要があります。管理者権限では、ユーザーはアクセスできないコマンドにアクセスすることができます。

管理者モードを有効にするには、スタートメニューを開き、cmdと入力し、cmdプログラムを右クリックして、「管理者として実行」を選択します。Windows 10では、スタートボタン上で右クリックし、「コマンドプロンプト(管理者)」を選択することもできます。

基本コマンドの一覧

CMDコマンドは数千種類あり、それぞれが独自の操作性を持っています。

[コマンド]/?

上記のコマンドは、指定された特定のコマンドに関する詳細な情報をユーザーに提供します。これは単純に、第三者のリソースに頼ることなく、ユーザーがコマンドを理解できるようにするために最も重要なことです。

sfc/scannow社

OSを再インストールすることなく、重要なシステムファイルを修復することができます。

このコマンドは、セーフモードで実行するのが最善です。すぐにオペレーティングシステムに問題が発生すると、完全な修復ができなくなる可能性があります。

キクデスケ

ファイルシステムのエラー、不良セクタを修復し、読み取り可能な情報を復元します。chkdskコマンドを実行する方法は2つあります。

  • chkdsk/F - chkdskを実行し、ファイルシステムのエラーを修正する。
  • chkdsk/R-エラーを修復し、不良セクタを見つけ出し、その不良エラーから情報を回復します。

フラット、パスフラット、tracert

Pingとpathping(pingをより包括的にしたもの)は、特定のウェブサイトに送られたパケットを送り返したり表示したりします。pathpingは、tracertと一緒に、目的のドメインへの各ルーター(またはリープポイント)のIPアドレスを表示します。

株式会社パワーエフジー

デフォルトでは、特定の電源構成(ハイバネーションモードなど)はオフに設定されています。ハイバーネートモードは、パソコンの電源を切る代わりに、パソコンの最後の状態(プログラム、ウィンドウなど)を保存し、より速く起動することができます。有効/無効を切り替えるには、次のコマンドを使用します。

  • powercfg/hibernate on-ハイバネートモードをオンにします。Windowsのデフォルトの電源オプションからアクセス可能です。
  • powercfg/hibernate off-ハイバネートモードをオフにします。

ドライバークエリ...>[ファイル名]です。

PCのドライバの頭と尻尾は意識していない方がほとんどだと思いますが、時にはドライバに問題が発生することがあります。これは、パフォーマンスの遅延のような小さなものから、安定したBSODのような大きなものまであります。

driverqueryはすぐに効果が出るものではありませんが、ハードウェアとソフトウェアの問題に総合的に対処するために、PCのドライバー情報を俯瞰することができます。

  • driverquery - インストールされているドライバーの一覧をソートして表示します。
  • driverquery/FO TABLE, LIST or CSV - ドライバをテーブル、リスト、またはエクセル スプレッドシートとして表示します。

元のパラメータ --driverquery/FO CSV> driverquery.csv に &gt[filename.csv] を追加すると、例えばコマンドプロンプトで driverquery で表示した情報を取得して Excel ワークシートに出力することができるようになります。デフォルトでは、ファイルはWindows32フォルダに誘導されます。

ipconfig/release、renew、flushdns。

IPアドレスの誤りやDNS(**** ware)ファイルの破損により、ネットワークに問題が発生することがあります。この問題を解決するには、以下のコマンドを順番に入力してください。

  • ipconfig/release-release あなたのIPアドレス。
  • ipconfig/renew-以前のIPアドレスを置き換えます(他の2つよりも時間がかかります)。
  • ipconfig/flushdns - 以前に構成された DNS リストを削除し、以前に利用できなかったサイトが再び読み込まれるようにします。

具体的には、インターネットに接続しているにもかかわらず、特定のWebサイトが動作しない場合です。

チップを注文してください

コマンドプロンプトは、あなたを混乱させるために作られたモンスターではありません**。シンプルな機能の中に、コンピュータのほぼすべての機能をコントロールする便利なツールがぎっしり詰まっているのです。コマンドプロンプトは、まだほんの一部です。

他にどんなコマンドを覚えたいですか? 下のコメント欄で教えてください。

Photo credit: Roman Marvel and Brian Goff via Shutterstock.com

  • 2021-03-15 18:07 に公開
  • 閲覧 ( 31 )
  • 分類:IT

あなたが興味を持っているかもしれない記事

匿名者
匿名者

0 件の投稿

作家リスト

  1. admin 0 投稿
  2. 匿名者 0 投稿

おすすめ