当我打开我的文件在其中写一些东西时,我得到了“权限被拒绝”。
Dim CustomDriveIcon As String CustomDriveIcon = "CustomDriveIcon_" & txtDrive.Text & ".reg" Dim newFIle Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") Set newFIle = FSO.CreateTextFile(CustomDriveIcon)
做事件
Dim sFileText As String
Dim iFileNo As Integer
iFileNo = FreeFile
Open CustomDriveIcon For Output As #iFileNo
Print #iFileNo, "Windows Registry Editor Version 5.00"
Print #iFileNo, ""
Print #iFileNo, "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\C\DefaultIcon]"
Print #iFileNo, "@=" & Chr(34) & "\" & Chr(34) & txtIconPath & "\" & Chr(34) & Chr(34) '@="\"C\""
Close #iFileNo
我在“”线上得到错误是Open CustomDriveIcon For Output As #iFileNo
什么问题?