⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hidefile.wsf

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 WSF
字号:
<job>
<runtime>
<description>
The hidefile.wsf filename script sets the hidden attribute
for a specified file
</description>
<named 
      name="FileName"
      helpstring="Name of file to hide."
      type="string"
      required="True"
/>
<example>
This is an example of how to use this script:
 Hidefile.wsf Filename:data.doc
</example>
</runtime>
<script language="VBScript">
If Not WScript.Arguments.Named.Exists("FileName") Then
  WScript.Arguments.ShowUsage
  WScript.Quit
 End If

Set objFileSystem = CreateObject("Scripting.FileSystemObject")
 On Error Resume Next
 'get the file specified in command line 

 strFile = WScript.Arguments.Named("FileName")
 Set objFile = objFileSystem.GetFile(strFile)
 'check if error occured - file not found
 If Err Then 
     WScript.Echo "File:'" & strFile & "' not found"
 Else
     objFile.Attributes = 2
 End If
 
</script>
</job>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -