📄 reboot.txt
字号:
#include "c:\ats\samples\ini.txt"
int EWX_LOGOFF = 0;
int EWX_SHUTDOWN = 1; //NT: needs SE_SHUTDOWN_NAME privilege (no def prompt)
int EWX_REBOOT = 2; //NT: needs SE_SHUTDOWN_NAME privilege
int EWX_FORCE = 4;
int EWX_POWEROFF = 8; //NT: needs SE_SHUTDOWN_NAME privilege
int shrsExitNoDefPrompt = 1;
int shrsRebootSystem = 2; // = EWX_REBOOT
function RebootAndRun(string Program, string Username, string Password, String Domain, int n)
begin
int i;
string space=" ";
string IniFileName="c:\round.ini";
i=IniFile_GetInt(IniFileName,Program,"RunCount",0);
i = i+1;
if (i>=n)
begin
Reg_DeleteValue( HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\RunServices", "Autologin");
Reg_DeleteValue( HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "ATS");
Sleep(5000);
DeleteFile(IniFileName);
end
else
begin
IniFile_Create(IniFileName);
IniFile_SetInt(IniFileName, Program, "Total", n);
IniFile_SetInt(IniFileName,Program,"RunCount",i);
Open( "..\tools\login.exe", Username+space+Password+space+Domain);
Reg_SetStr( HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "ATS", Program);
// ShellRestartSystem(0,"Hahaha! ",7);
// ShellShutDown(0);
// Restart();
Sleep(10000);
Press("Enter");
end
end
function Reboot(string Program, int n, string IniFileName)
begin
int i;
string space=" ";
i=IniFile_GetInt(IniFileName,Program,"RunCount",0);
i = i+1;
if (i>=n)
begin
Reg_DeleteValue( HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "ATS");
Sleep(5000);
DeleteFile(IniFileName);
end
else
begin
IniFile_Create(IniFileName);
IniFile_SetInt(IniFileName, Program, "Total", n);
IniFile_SetInt(IniFileName,Program,"RunCount",i);
Reg_SetStr( HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", "ATS", Program);
Open("c:\ats\tools\reboot.exe", "2 5000");
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -