• 追加された行はこの色です。
  • 削除された行はこの色です。
* set - setx - 環境変数の操作 [#ee91d735]

 set foo=
** set [#da154531]

** [#e224c9ee]
*** 代入・再代入 [#t37346db]
 set mesg=hello
 echo %mesg%
   => "hello"
 
 set mesg=%mesg%, world
 echo %mesg%
   => "hello, world"

*** 数値演算 [#t093ec53]
 set num1=10
 set /a num2=%num1%*2
 echo %num2%
   => "20"

*** 文字列置換 [#x6cb54dd]
 set mesg=foo
 set mesg=%mesg:oo=xx%
 echo %mesg%
   => "fxx"

*** 部分文字列の取り出し [#v73d4402]
 set mesg=foo
 set mesg=%mesg:~0,2%
 echo %mesg%
   => "fo"

*** 参考 [#odd1cf02]
http://www.geocities.co.jp/SiliconValley-SanJose/1227/variable.html

** setx [#f42b8254]
*** ユーザ環境変数の設定 [#re218fb7]
 setx PATH "%PATH%;C:\App\bin"

*** システム環境変数の設定 [#d7933129]
 setx /m PATH "%PATH%;C:\App\bin"

*** 参考 [#lf4f8ac3]
- http://www.atmarkit.co.jp/fwin2k/win2ktips/1003setx/setx.html
- http://www.atmarkit.co.jp/fwin2k/win2ktips/1006setxf/setxf.html


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS