如何为特定的 .cmd 文件禁用 SmartScreen?
How to disable SmartScreen for a specific .cmd file?
我最近制作了一组 .cmd 文件。
称为 'Node.1.cmd' 和 'Node.2.cmd',文件的目的应该是相互打开(在类似链的过程中)。
但是,每当我打开这两个中的一个时,它都会给我一条非常烦人的消息:
Windows 保护了您的 PC。
Windows SmartScreen 阻止无法识别的应用程序启动。 运行 此应用程序可能会使您的 PC 面临风险。
我同意这有点冒险,但它是为了好玩而不是为了破坏而制作的。这只是我向人们展示不要弄乱我的东西的方式。我什至没有在我的桌面上为文件设置任何 LNK。
现在,进入正题,我能否在保持该文件打开的同时将其从 SmartScreen 中排除?
因此,我无法用 .vbs 文件打开它
更具体地说,它打开但随后自动关闭并显示一条消息:
该系统找不到指定的路径。
windows SmartScreen 是否加密文件或类似的东西?
我编写了以下脚本:
Titre = "What would you like to do ? RookieTEC9©"
message = "What would you like to do ?"&vbcr&vbcr&_
"1 - Launch Project Node "&vbcr&_
"2 - Launch Golden Chrome"&vbcr&_
"3 - Launch An Application"&vbcr&_
"4 - Start Windows Update"&vbcr&_
"5 - Slide2Kill"
Default ="1"
Question = InputBox(message,Titre,Default)
Select Case Question
Case 1 Run(1)
Case 2 Run(2)
Case 3 Run(3)
Case 4 Run(4)
Case 5 Run(5)
end Select
Sub Run(var)
Set WS = CreateObject("WScript.shell")
Select Case var
Case 1 WS.run("explorer.exe /e,C:\Users\Jeremi\OneDrive\Happy_files\Unsorted_Files\Project_Node.zip\Node.1.cmd")
Case 2 ProcessNotNeeded()
Case 3 LaunchApplication()
Case 4 WindowsUpdate()
Case 5 WS.run("SlideToShutDown.exe")
End select
End Sub
Sub Kill(Process)
Set Ws = CreateObject("Wscript.Shell")
Command = "cmd /c Taskkill /F /IM "&Process&""
Execution = Ws.Run(Command,0,False)
End Sub
Sub ProcessNotNeeded()
Titre = "Killing Process Not Needed RookieTEC9© "
message = "Type the Name of the process to be killed by this script"&vbcr&_
"Example To Kill The Internet Explorer Process You should type"&vbcr&_
"iexplore.exe"
Default ="iexplore.exe"
Question = InputBox(message,Titre,Default)
Kill(Question)
End Sub
Function CmdPrompt(sCmd)
Dim sCmdLine,oWS,nRes
set oWS = CreateObject("Wscript.Shell")
sCmdLine = "cmd /c Start " & sCmd & ""
nRes = oWS.Run(sCmdLine,0,False)
CmdPrompt = nRes
End Function
Sub LaunchApplication()
Titre = "Launching an Application"
message = "Type the Name of the process to be Lanuched by this script"&vbcr&_
"Example To Launch The Word Application You should type"&vbcr&_
"Winword.exe"
Default ="Winword.exe"
Question = InputBox(message,Titre,Default)
CmdPrompt(Question)
End Sub
Sub WindowsUpdate()
Title = "Checking for Windows updates"
Msg = "Looking for a list of updates, So be Patient Thank you !"
Wait = "70" 'waiting 70 secondes to close the popup
Set Ws = CreateObject("Wscript.Shell")
ws.Popup Msg,wait,Title,64
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
If searchResult.Updates.Count <> 0 Then 'If updates were found
'so with this loop shows how you can list the title of each update that was found.
For i = 0 To searchResult.Updates.Count - 1
Set update = searchResult.Updates.Item(i)
ws.Popup update.Title,wait,Title,64
Next
End If
Ws.Run "wuauclt.exe /reportnow /detectnow",1,False
End Sub
抱歉代码太长了!
100% 诚实地说,我不是从头开始创建它,我只是对其进行了编辑。
我是 VBS 新手
但是,如果您对 HTML 或 CSS 有任何疑问,我也许可以回答。
请记住,我是一名五年级学生,本学年才开始编码。
谢谢你的时间和回答。
P.S。
此外,该文件是一个 zip 文件。有影响吗?
我最近制作了一组 .cmd 文件。
称为 'Node.1.cmd' 和 'Node.2.cmd',文件的目的应该是相互打开(在类似链的过程中)。
但是,每当我打开这两个中的一个时,它都会给我一条非常烦人的消息:
Windows 保护了您的 PC。
Windows SmartScreen 阻止无法识别的应用程序启动。 运行 此应用程序可能会使您的 PC 面临风险。
我同意这有点冒险,但它是为了好玩而不是为了破坏而制作的。这只是我向人们展示不要弄乱我的东西的方式。我什至没有在我的桌面上为文件设置任何 LNK。
现在,进入正题,我能否在保持该文件打开的同时将其从 SmartScreen 中排除?
因此,我无法用 .vbs 文件打开它
更具体地说,它打开但随后自动关闭并显示一条消息:
该系统找不到指定的路径。
windows SmartScreen 是否加密文件或类似的东西?
我编写了以下脚本:
Titre = "What would you like to do ? RookieTEC9©"
message = "What would you like to do ?"&vbcr&vbcr&_
"1 - Launch Project Node "&vbcr&_
"2 - Launch Golden Chrome"&vbcr&_
"3 - Launch An Application"&vbcr&_
"4 - Start Windows Update"&vbcr&_
"5 - Slide2Kill"
Default ="1"
Question = InputBox(message,Titre,Default)
Select Case Question
Case 1 Run(1)
Case 2 Run(2)
Case 3 Run(3)
Case 4 Run(4)
Case 5 Run(5)
end Select
Sub Run(var)
Set WS = CreateObject("WScript.shell")
Select Case var
Case 1 WS.run("explorer.exe /e,C:\Users\Jeremi\OneDrive\Happy_files\Unsorted_Files\Project_Node.zip\Node.1.cmd")
Case 2 ProcessNotNeeded()
Case 3 LaunchApplication()
Case 4 WindowsUpdate()
Case 5 WS.run("SlideToShutDown.exe")
End select
End Sub
Sub Kill(Process)
Set Ws = CreateObject("Wscript.Shell")
Command = "cmd /c Taskkill /F /IM "&Process&""
Execution = Ws.Run(Command,0,False)
End Sub
Sub ProcessNotNeeded()
Titre = "Killing Process Not Needed RookieTEC9© "
message = "Type the Name of the process to be killed by this script"&vbcr&_
"Example To Kill The Internet Explorer Process You should type"&vbcr&_
"iexplore.exe"
Default ="iexplore.exe"
Question = InputBox(message,Titre,Default)
Kill(Question)
End Sub
Function CmdPrompt(sCmd)
Dim sCmdLine,oWS,nRes
set oWS = CreateObject("Wscript.Shell")
sCmdLine = "cmd /c Start " & sCmd & ""
nRes = oWS.Run(sCmdLine,0,False)
CmdPrompt = nRes
End Function
Sub LaunchApplication()
Titre = "Launching an Application"
message = "Type the Name of the process to be Lanuched by this script"&vbcr&_
"Example To Launch The Word Application You should type"&vbcr&_
"Winword.exe"
Default ="Winword.exe"
Question = InputBox(message,Titre,Default)
CmdPrompt(Question)
End Sub
Sub WindowsUpdate()
Title = "Checking for Windows updates"
Msg = "Looking for a list of updates, So be Patient Thank you !"
Wait = "70" 'waiting 70 secondes to close the popup
Set Ws = CreateObject("Wscript.Shell")
ws.Popup Msg,wait,Title,64
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
If searchResult.Updates.Count <> 0 Then 'If updates were found
'so with this loop shows how you can list the title of each update that was found.
For i = 0 To searchResult.Updates.Count - 1
Set update = searchResult.Updates.Item(i)
ws.Popup update.Title,wait,Title,64
Next
End If
Ws.Run "wuauclt.exe /reportnow /detectnow",1,False
End Sub
抱歉代码太长了!
100% 诚实地说,我不是从头开始创建它,我只是对其进行了编辑。
我是 VBS 新手
但是,如果您对 HTML 或 CSS 有任何疑问,我也许可以回答。
请记住,我是一名五年级学生,本学年才开始编码。
谢谢你的时间和回答。
P.S。
此外,该文件是一个 zip 文件。有影响吗?