创建一个复制文件的脚本
Dim fsoSet fso=Createobject("Scripting.FilesyStemObject")fso.CopyFile "C:\Windows\System32\cmd.exe","E:\"Set fso=Nothing
移动文件
Dim fso, filepathSet fso=Createobject("Scripting.FilesyStemObject")filepath="C:\Windows\System32\cmd.exe"If fso.FileExists(E:\cmd.exe) ThenMsgBox "文件已存在"Elsefso.MoveFile filepath,"E:\"End ifSet fso=Nothing
重命名文件
Dim fso, filepath,fSet fso=Createobject("Scripting.FilesyStemObject")filepath="C:\Windows\System32\cmd.exe"Set f=fso.GetFile(filepath)'f.Copy(),f.move() 也可以重命名文件f.Name="运行命令狂.exe"Set fso=Nothing
向文件里写入
Dim fso, filepath,fSet fso=Createobject("Scripting.FilesyStemObject")filepath="e:\a.txt"Set f=fso.CreateTextFile(filepath)For i=1 To 100f.WriteLine iNextf.CloseSet fso=Nothing
文章转载自Louise的50个梦想,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




