A Troupe of little vagrants of the world, leave your footprints in my words.--我的文摘本.
查看文章 |
Windows Power Shell--新建一个文件和文件夹
2008-03-19 13:12
译者:Anders 新建一个文件和文件夹 在你的计算机上New-Item 是一个创建新文件和文件夹快而简单的的方法。 举个例子,架设你想在 C:\Scripts 文件夹内建立一个新的目录名为 Windows PowerShell 文件。仅仅只要使用New-Item : 1)新文件夹的完整路径; 2)新的项目类型(其中你可以置顶使用 -type 参数与目录值)。这个命令在问题中看起来像这样: 代码:New-Item c:\scriptsWindows PowerShell -type directory代码:New-Item c:\scripts ew_file.txt -type file代码:New-Item : The file 'C:\scripts ew_file.txt' already exists.代码:New-Item c:\scripts ew_file.txt -type file -force说到全部更新,为空文件,你也可以使用 -value 参数来添加一些数据到你的新文件里。这个命令上加上一句,This is text added to the file 的同时建立一个New_file.txt : 代码:New-Item c:\scripts ew_file.txt -type file -force -value "This is text added to the file" |
最近读者: