vb 建立文件并发送到system32。。。代码简短且运行得了就OK10分

来源:百度知道 编辑:UC知道 时间:2024/06/23 08:47:29
那如果在X:\WINDOWS\system32里面建立这taskmgr.exe.manifest文件怎么办。?速度。10分。

如果只是创建那好办:

Private Sub Command1_Click()
Dim mCFile As Object
Set mCFile = CreateObject("Scripting.FileSystemObject")
mCFile.CreateTextFile "c:\windows\system32\我的文件.txt", True
Set mCFile = Nothing
End Sub

文件的扩展名可自定义,如果要写数据到文件就要加用WriteLine 了。

----------------------------------------------------
晕~~,我不是说过扩展名叫啥都可以吗,把“我的文件.txt”换成“taskmgr.exe.manifest”不就得了,我试过可以的。

Dim file1 as New FileInfo("c:\windows\system32\文件名") '创建文件变量file1,并设定变量值为”c:\windows\system32\文件名”

file1.Create '创建文件

以上代码环境为VB2005版本