скрипт выключение компьютера [Решено]
Цитата: intyiciya от 18.03.2021, 16:54можно скрипт на выключение компьютера?)
обновить оболчку есть и перезагрузка есть от твикера...
[MNotice]У нас принято здороваться[/MNotice]
можно скрипт на выключение компьютера?)
обновить оболчку есть и перезагрузка есть от твикера...
Комментарий модератора:
У нас принято здороваться
Цитата: intyiciya от 18.03.2021, 17:00извените...
Здравствуйте...
извените...
Здравствуйте...
Цитата: Сергей от 18.03.2021, 17:05Добрый день 🖐
Пожалуйста. Осторожно, двойной клик по файлу сразу выключит комп.
Добрый день 🖐
Пожалуйста. Осторожно, двойной клик по файлу сразу выключит комп.
Цитата: intyiciya от 18.03.2021, 17:18Цитата: Сергей от 18.03.2021, 17:05Добрый день
Пожалуйста. Осторожно, двойной клик по файлу сразу выключит комп.спасибо,а как изменить иконочку?)
Цитата: Сергей от 18.03.2021, 17:05Добрый день
Пожалуйста. Осторожно, двойной клик по файлу сразу выключит комп.
спасибо,а как изменить иконочку?)
Цитата: ЯR от 18.03.2021, 17:22Здравствуйте!
Переместите vbs-скрипт в нужное вам место, далее, создайте ярлык на данный скрипт, на Рабочем столе, например, и в свойствах ярлыка, измените иконку.
Здравствуйте!
Переместите vbs-скрипт в нужное вам место, далее, создайте ярлык на данный скрипт, на Рабочем столе, например, и в свойствах ярлыка, измените иконку.
Цитата: intyiciya от 18.03.2021, 17:32Цитата: Яр от 18.03.2021, 17:22Здравствуйте!
Переместите vbs-скрипт в нужное вам место, далее, создайте ярлык на данный скрипт, на Рабочем столе, например, и в свойствах ярлыка, измените иконку.спасибо
Цитата: Яр от 18.03.2021, 17:22Здравствуйте!
Переместите vbs-скрипт в нужное вам место, далее, создайте ярлык на данный скрипт, на Рабочем столе, например, и в свойствах ярлыка, измените иконку.
спасибо
Цитата: Roman от 29.03.2024, 09:09Цитата: Сергей от 18.03.2021, 17:05Добрый день
Пожалуйста. Осторожно, двойной клик по файлу сразу выключит комп.Здравствуйте.Можно скрипт?
Цитата: Сергей от 18.03.2021, 17:05Добрый день
Пожалуйста. Осторожно, двойной клик по файлу сразу выключит комп.
Здравствуйте.Можно скрипт?
Цитата: Mikhail от 29.03.2024, 10:35Roman, Привет.
Отдельно:
[spoiler title="Скрипт"]Set objShell = CreateObject("WScript.Shell") objShell.Run "shutdown -s -t 0"[/spoiler]
В Авторском скрипте от Хачатура:
Аргумент-shutdown
[spoiler title="Скрипт"]'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub[/spoiler]
Roman, Привет.
Отдельно:
Set objShell = CreateObject("WScript.Shell")
objShell.Run "shutdown -s -t 0"
В Авторском скрипте от Хачатура:
Аргумент
Скопировано-shutdown'Script by XpucT
Set o = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.Count = 0 Then
WScript.Quit
End If
If WScript.Arguments(0) = "-refresh" Then
Call Refresh
ElseIf WScript.Arguments(0) = "-reboot" Then
Call Reboot
ElseIf WScript.Arguments(0) = "-shutdown" Then
Call Shutdown
End If
Sub Refresh
o.Run "ie4uinit.exe -show"
o.Run "ie4uinit.exe -ClearIconCache"
WScript.Sleep 1000
Set fso = CreateObject("Scripting.FileSystemObject")
local = o.ExpandEnvironmentStrings("%LocalAppData%")
path = "\Microsoft\Internet Explorer\"
If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then
fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log"
End If
If fso.FileExists(local & path & "ie4uinit-show.log") Then
fso.DeleteFile local & path & "ie4uinit-show.log"
End If
If fso.FileExists(local & path & "brndlog.txt") Then
fso.DeleteFile local & path & "brndlog.txt"
End If
If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then
fso.DeleteFile local & path & "ie4uinit-UserConfig.log"
End If
End Sub
Sub Reboot
o.Run "cmd /c shutdown -r -f -t 0", 0, True
End Sub
Sub Shutdown
o.Run "cmd /c shutdown -s -t 0", 0, True
End Sub
Цитата: Roman от 29.03.2024, 12:05Спасибо!
Спасибо!
Цитата: Roman от 29.03.2024, 14:25Цитата: Mikhail от 29.03.2024, 10:35Roman, Привет.
Отдельно:
[spoiler title="Скрипт"]Set objShell = CreateObject("WScript.Shell")objShell.Run "shutdown -s -t 0"Set objShell = CreateObject("WScript.Shell") objShell.Run "shutdown -s -t 0"Set objShell = CreateObject("WScript.Shell") objShell.Run "shutdown -s -t 0"[/spoiler]
В Авторском скрипте от Хачатура:
Аргумент-shutdown
[spoiler title="Скрипт"]'Script by XpucTSet o = WScript.CreateObject("WScript.Shell")If WScript.Arguments.Count = 0 ThenWScript.QuitEnd IfIf WScript.Arguments(0) = "-refresh" ThenCall RefreshElseIf WScript.Arguments(0) = "-reboot" ThenCall RebootElseIf WScript.Arguments(0) = "-shutdown" ThenCall ShutdownEnd IfSub Refresho.Run "ie4uinit.exe -show"o.Run "ie4uinit.exe -ClearIconCache"WScript.Sleep 1000Set fso = CreateObject("Scripting.FileSystemObject")local = o.ExpandEnvironmentStrings("%LocalAppData%")path = "\Microsoft\Internet Explorer\"If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Thenfso.DeleteFile local & path & "ie4uinit-ClearIconCache.log"End IfIf fso.FileExists(local & path & "ie4uinit-show.log") Thenfso.DeleteFile local & path & "ie4uinit-show.log"End IfIf fso.FileExists(local & path & "brndlog.txt") Thenfso.DeleteFile local & path & "brndlog.txt"End IfIf fso.FileExists(local & path & "ie4uinit-UserConfig.log") Thenfso.DeleteFile local & path & "ie4uinit-UserConfig.log"End IfEnd SubSub Rebooto.Run "cmd /c shutdown -r -f -t 0", 0, TrueEnd SubSub Shutdowno.Run "cmd /c shutdown -s -t 0", 0, TrueEnd Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub[/spoiler]
Здравствуйте.Подскажите можно добавить в скрипт очистку кеша DNS ?
Цитата: Mikhail от 29.03.2024, 10:35Roman, Привет.
Отдельно:
СкриптSet objShell = CreateObject("WScript.Shell")objShell.Run "shutdown -s -t 0"Set objShell = CreateObject("WScript.Shell") objShell.Run "shutdown -s -t 0"Set objShell = CreateObject("WScript.Shell") objShell.Run "shutdown -s -t 0"
В Авторском скрипте от Хачатура:
АргументСкопировано-shutdown
Скрипт'Script by XpucTSet o = WScript.CreateObject("WScript.Shell")If WScript.Arguments.Count = 0 ThenWScript.QuitEnd IfIf WScript.Arguments(0) = "-refresh" ThenCall RefreshElseIf WScript.Arguments(0) = "-reboot" ThenCall RebootElseIf WScript.Arguments(0) = "-shutdown" ThenCall ShutdownEnd IfSub Refresho.Run "ie4uinit.exe -show"o.Run "ie4uinit.exe -ClearIconCache"WScript.Sleep 1000Set fso = CreateObject("Scripting.FileSystemObject")local = o.ExpandEnvironmentStrings("%LocalAppData%")path = "\Microsoft\Internet Explorer\"If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Thenfso.DeleteFile local & path & "ie4uinit-ClearIconCache.log"End IfIf fso.FileExists(local & path & "ie4uinit-show.log") Thenfso.DeleteFile local & path & "ie4uinit-show.log"End IfIf fso.FileExists(local & path & "brndlog.txt") Thenfso.DeleteFile local & path & "brndlog.txt"End IfIf fso.FileExists(local & path & "ie4uinit-UserConfig.log") Thenfso.DeleteFile local & path & "ie4uinit-UserConfig.log"End IfEnd SubSub Rebooto.Run "cmd /c shutdown -r -f -t 0", 0, TrueEnd SubSub Shutdowno.Run "cmd /c shutdown -s -t 0", 0, TrueEnd Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub
Здравствуйте.Подскажите можно добавить в скрипт очистку кеша DNS ?
Цитата: Mikhail от 29.03.2024, 14:47Roman, Можно.
-cleardns
[spoiler title="Скрипт"]'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown ElseIf WScript.Arguments(0) = "-cleardns" Then Call ClearDNSCache End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub Sub ClearDNSCache o.Run "cmd /c ipconfig /flushdns", 0, True End Sub[/spoiler]
Roman, Можно.
Скопировано-cleardns
'Script by XpucT
Set o = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.Count = 0 Then
WScript.Quit
End If
If WScript.Arguments(0) = "-refresh" Then
Call Refresh
ElseIf WScript.Arguments(0) = "-reboot" Then
Call Reboot
ElseIf WScript.Arguments(0) = "-shutdown" Then
Call Shutdown
ElseIf WScript.Arguments(0) = "-cleardns" Then
Call ClearDNSCache
End If
Sub Refresh
o.Run "ie4uinit.exe -show"
o.Run "ie4uinit.exe -ClearIconCache"
WScript.Sleep 1000
Set fso = CreateObject("Scripting.FileSystemObject")
local = o.ExpandEnvironmentStrings("%LocalAppData%")
path = "\Microsoft\Internet Explorer\"
If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then
fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log"
End If
If fso.FileExists(local & path & "ie4uinit-show.log") Then
fso.DeleteFile local & path & "ie4uinit-show.log"
End If
If fso.FileExists(local & path & "brndlog.txt") Then
fso.DeleteFile local & path & "brndlog.txt"
End If
If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then
fso.DeleteFile local & path & "ie4uinit-UserConfig.log"
End If
End Sub
Sub Reboot
o.Run "cmd /c shutdown -r -f -t 0", 0, True
End Sub
Sub Shutdown
o.Run "cmd /c shutdown -s -t 0", 0, True
End Sub
Sub ClearDNSCache
o.Run "cmd /c ipconfig /flushdns", 0, True
End Sub
Цитата: Roman от 29.03.2024, 15:23Большое спасибо!
Большое спасибо!
Цитата: Roman от 30.03.2024, 06:14Цитата: Mikhail от 29.03.2024, 14:47Roman, Можно.
-cleardns
[spoiler title="Скрипт"]'Script by XpucTSet o = WScript.CreateObject("WScript.Shell")If WScript.Arguments.Count = 0 ThenWScript.QuitEnd IfIf WScript.Arguments(0) = "-refresh" ThenCall RefreshElseIf WScript.Arguments(0) = "-reboot" ThenCall RebootElseIf WScript.Arguments(0) = "-shutdown" ThenCall ShutdownElseIf WScript.Arguments(0) = "-cleardns" ThenCall ClearDNSCacheEnd IfSub Refresho.Run "ie4uinit.exe -show"o.Run "ie4uinit.exe -ClearIconCache"WScript.Sleep 1000Set fso = CreateObject("Scripting.FileSystemObject")local = o.ExpandEnvironmentStrings("%LocalAppData%")path = "\Microsoft\Internet Explorer\"If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Thenfso.DeleteFile local & path & "ie4uinit-ClearIconCache.log"End IfIf fso.FileExists(local & path & "ie4uinit-show.log") Thenfso.DeleteFile local & path & "ie4uinit-show.log"End IfIf fso.FileExists(local & path & "brndlog.txt") Thenfso.DeleteFile local & path & "brndlog.txt"End IfIf fso.FileExists(local & path & "ie4uinit-UserConfig.log") Thenfso.DeleteFile local & path & "ie4uinit-UserConfig.log"End IfEnd SubSub Rebooto.Run "cmd /c shutdown -r -f -t 0", 0, TrueEnd SubSub Shutdowno.Run "cmd /c shutdown -s -t 0", 0, TrueEnd SubSub ClearDNSCacheo.Run "cmd /c ipconfig /flushdns", 0, TrueEnd Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown ElseIf WScript.Arguments(0) = "-cleardns" Then Call ClearDNSCache End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub Sub ClearDNSCache o.Run "cmd /c ipconfig /flushdns", 0, True End Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown ElseIf WScript.Arguments(0) = "-cleardns" Then Call ClearDNSCache End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub Sub ClearDNSCache o.Run "cmd /c ipconfig /flushdns", 0, True End Sub[/spoiler]
Доброе утро.Возможно я Вам надоел можете написать что бы показывало окно?С батниками получается с vbs ну ни как.
За ранее спасибо.
Цитата: Mikhail от 29.03.2024, 14:47Roman, Можно.
Скопировано-cleardns
Скрипт'Script by XpucTSet o = WScript.CreateObject("WScript.Shell")If WScript.Arguments.Count = 0 ThenWScript.QuitEnd IfIf WScript.Arguments(0) = "-refresh" ThenCall RefreshElseIf WScript.Arguments(0) = "-reboot" ThenCall RebootElseIf WScript.Arguments(0) = "-shutdown" ThenCall ShutdownElseIf WScript.Arguments(0) = "-cleardns" ThenCall ClearDNSCacheEnd IfSub Refresho.Run "ie4uinit.exe -show"o.Run "ie4uinit.exe -ClearIconCache"WScript.Sleep 1000Set fso = CreateObject("Scripting.FileSystemObject")local = o.ExpandEnvironmentStrings("%LocalAppData%")path = "\Microsoft\Internet Explorer\"If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Thenfso.DeleteFile local & path & "ie4uinit-ClearIconCache.log"End IfIf fso.FileExists(local & path & "ie4uinit-show.log") Thenfso.DeleteFile local & path & "ie4uinit-show.log"End IfIf fso.FileExists(local & path & "brndlog.txt") Thenfso.DeleteFile local & path & "brndlog.txt"End IfIf fso.FileExists(local & path & "ie4uinit-UserConfig.log") Thenfso.DeleteFile local & path & "ie4uinit-UserConfig.log"End IfEnd SubSub Rebooto.Run "cmd /c shutdown -r -f -t 0", 0, TrueEnd SubSub Shutdowno.Run "cmd /c shutdown -s -t 0", 0, TrueEnd SubSub ClearDNSCacheo.Run "cmd /c ipconfig /flushdns", 0, TrueEnd Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown ElseIf WScript.Arguments(0) = "-cleardns" Then Call ClearDNSCache End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub Sub ClearDNSCache o.Run "cmd /c ipconfig /flushdns", 0, True End Sub'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown ElseIf WScript.Arguments(0) = "-cleardns" Then Call ClearDNSCache End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub Sub ClearDNSCache o.Run "cmd /c ipconfig /flushdns", 0, True End Sub
Доброе утро.Возможно я Вам надоел можете написать что бы показывало окно?С батниками получается с vbs ну ни как.
За ранее спасибо.
Цитата: Mikhail от 30.03.2024, 06:17Roman, Привет.
Добавил строкуo.Popup "Кэш сопоставителя DNS успешно очищен.", 1, "DNS Cache", vbInformation + vbOKOnly, "1" это сколько секунд будет окно висеть, либо вообще удали эту строку чтоб самим нажать "ок"
[spoiler title="Скрипт"]'Script by XpucT Set o = WScript.CreateObject("WScript.Shell") If WScript.Arguments.Count = 0 Then WScript.Quit End If If WScript.Arguments(0) = "-refresh" Then Call Refresh ElseIf WScript.Arguments(0) = "-reboot" Then Call Reboot ElseIf WScript.Arguments(0) = "-shutdown" Then Call Shutdown ElseIf WScript.Arguments(0) = "-cleardns" Then Call ClearDNSCache End If Sub Refresh o.Run "ie4uinit.exe -show" o.Run "ie4uinit.exe -ClearIconCache" WScript.Sleep 1000 Set fso = CreateObject("Scripting.FileSystemObject") local = o.ExpandEnvironmentStrings("%LocalAppData%") path = "\Microsoft\Internet Explorer\" If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log" End If If fso.FileExists(local & path & "ie4uinit-show.log") Then fso.DeleteFile local & path & "ie4uinit-show.log" End If If fso.FileExists(local & path & "brndlog.txt") Then fso.DeleteFile local & path & "brndlog.txt" End If If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then fso.DeleteFile local & path & "ie4uinit-UserConfig.log" End If End Sub Sub Reboot o.Run "cmd /c shutdown -r -f -t 0", 0, True End Sub Sub Shutdown o.Run "cmd /c shutdown -s -t 0", 0, True End Sub Sub ClearDNSCache o.Run "cmd /c ipconfig /flushdns", 0, True o.Popup "Кэш сопоставителя DNS успешно очищен.", 1, "DNS Cache", vbInformation + vbOKOnly End Sub[/spoiler]
Roman, Привет.
Добавил строку Скопированоo.Popup "Кэш сопоставителя DNS успешно очищен.", 1, "DNS Cache", vbInformation + vbOKOnly, "1" это сколько секунд будет окно висеть, либо вообще удали эту строку чтоб самим нажать "ок"
'Script by XpucT
Set o = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.Count = 0 Then
WScript.Quit
End If
If WScript.Arguments(0) = "-refresh" Then
Call Refresh
ElseIf WScript.Arguments(0) = "-reboot" Then
Call Reboot
ElseIf WScript.Arguments(0) = "-shutdown" Then
Call Shutdown
ElseIf WScript.Arguments(0) = "-cleardns" Then
Call ClearDNSCache
End If
Sub Refresh
o.Run "ie4uinit.exe -show"
o.Run "ie4uinit.exe -ClearIconCache"
WScript.Sleep 1000
Set fso = CreateObject("Scripting.FileSystemObject")
local = o.ExpandEnvironmentStrings("%LocalAppData%")
path = "\Microsoft\Internet Explorer\"
If fso.FileExists(local & path & "ie4uinit-ClearIconCache.log") Then
fso.DeleteFile local & path & "ie4uinit-ClearIconCache.log"
End If
If fso.FileExists(local & path & "ie4uinit-show.log") Then
fso.DeleteFile local & path & "ie4uinit-show.log"
End If
If fso.FileExists(local & path & "brndlog.txt") Then
fso.DeleteFile local & path & "brndlog.txt"
End If
If fso.FileExists(local & path & "ie4uinit-UserConfig.log") Then
fso.DeleteFile local & path & "ie4uinit-UserConfig.log"
End If
End Sub
Sub Reboot
o.Run "cmd /c shutdown -r -f -t 0", 0, True
End Sub
Sub Shutdown
o.Run "cmd /c shutdown -s -t 0", 0, True
End Sub
Sub ClearDNSCache
o.Run "cmd /c ipconfig /flushdns", 0, True
o.Popup "Кэш сопоставителя DNS успешно очищен.", 1, "DNS Cache", vbInformation + vbOKOnly
End Sub
