我需要把这段代码转换为VBScript如何将.Net代码转换为vbscript?
SetAttr("C:\Users\" + Environment.UserName + "\Desktop\Client.exe", FileAttribute.Hidden)
任何人都可以让我在VBScript上面的代码?
我需要把这段代码转换为VBScript如何将.Net代码转换为vbscript?
SetAttr("C:\Users\" + Environment.UserName + "\Desktop\Client.exe", FileAttribute.Hidden)
任何人都可以让我在VBScript上面的代码?
您必须使用FileSystemObject。提示:这可能很容易搜索到。
例子:
Sub HideFolderFiles(filespec)
Dim fs, f, r
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(filespec).Files
f.attributes = 2 'hidden
End Sub
来源:https://www.experts-exchange.com/questions/28054761/VBScript-to-set-file-attributes.html
请看看[如何对提问](http://stackoverflow.com/help/how-to-ask) – swe