윈 도 우 file_folder2Hide&show, vbe <--> vbs
2020.04.03 15:32
SendTo_copyfilefolder2Hide.vbs를 실행하여 ---file_folder2Hide---.vbs를 SendTo폴더에 복사
---file_folder2Hide---.vbs(투박하지만 작동함)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Args = WScript.Arguments
If (Fso.FolderExists(Args(0))) Then
Set gFolder = Fso.GetFolder(Args(0))
gDir = Fso.GetParentFolderName(gFolder)
strDir = gDir & "\s-h-o-w-FOLDER.vbs"
Set outFile = Fso.CreateTextFile(strDir, True)
outFile.WriteLine "Set Fso = CreateObject(""Scripting.FileSystemObject"")"
outFile.WriteLine "Set gFolder = Fso.GetFolder(""" & gFolder & """)"
outFile.WriteLine "gFolder.Attributes = gFolder.Attributes AND NOT 2"
outFile.WriteLine "Fso.DeleteFile Wscript.ScriptFullName, True"
outFile.WriteLine "Set Fso = nothing"
outFile.WriteLine "Set gFolder = nothing"
outFile.WriteLine "WScript.Quit"
outFile.Close
gFolder.Attributes = gFolder.Attributes XOR 2
Else
Set gFile = Fso.GetFile(Args(0))
gDir = Fso.GetParentFolderName(gFile)
strDir = gDir & "\s-h-o-w-FILE.vbs"
Set outFile = Fso.CreateTextFile(strDir, True)
outFile.WriteLine "Set Fso = CreateObject(""Scripting.FileSystemObject"")"
outFile.WriteLine "Set gFile = Fso.GetFile(""" & gFile & """)"
outFile.WriteLine "gFile.Attributes = gFile.Attributes AND NOT 2"
outFile.WriteLine "Fso.DeleteFile Wscript.ScriptFullName, True"
outFile.WriteLine "Set Fso = nothing"
outFile.WriteLine "Set gFile= nothing"
outFile.WriteLine "WScript.Quit"
outFile.Close
gFile.Attributes = gFile.Attributes XOR 2
End If
Set Fso = nothing
Set Args = nothing
Set gFolder = nothing
Set gFile= nothing
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
============================
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\FSO\ScriptLog.txt")
If objFile.Attributes AND 0 Then
Wscript.Echo "No attributes set."
End If
If objFile.Attributes AND 1 Then
Wscript.Echo "Read-only."
End If
If objFile.Attributes AND 2 Then
Wscript.Echo "Hidden file."
End If
If objFile.Attributes AND 4 Then
Wscript.Echo "System file."
End If
If objFile.Attributes AND 32 Then
Wscript.Echo "Archive bit set."
End If
If objFile.Attributes AND 64 Then
Wscript.Echo "Link or shortcut."
End If
If objFile.Attributes AND 2048 Then
Wscript.Echo "Compressed file."
End If
============================
If objFolder.Attributes AND 2 Then
Wscript.Echo "Hidden folder."
End If
If objFolder.Attributes AND 4 Then
Wscript.Echo "System folder."
End If
If objFolder.Attributes AND 16 Then
Wscript.Echo "Folder."
End If
If objFolder.Attributes AND 32 Then
Wscript.Echo "Archive bit set."
End If
If objFolder.Attributes AND 2048 Then
Wscript.Echo "Compressed folder."
End If
=========================
---Encode-vbs2vbe---.vbs와 ---Decode-vbe2vbs---
SendTo_copyEncodeDecodeVBSVBE.vbs를 실행하여
---Encode-vbs2vbe---.vbs와 ---Decode-vbe2vbs---.vbs를 SendTo폴더에 복사
제가 만든 파일 아니고 외국자료입니다
[예] Svchost_reducer.vbe 마우스 우클릭 --> 보내기 --> "---Decode-vbe2vbs---.vbs" 클릭
수고 많으셨습니다. 감사합니다.