Code:
#NoTrayIcon
#SingleInstance, Force
#MaxMem 1
#MaxThreads 3
if A_OSVersion = WIN_7
{
Loop, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesOnce, 0, 0
{
if A_LoopRegType = REG_SZ
{
RegRead, OutputVar
Run "%OutputVar%",, UseErrorLevel
if ErrorLevel = ERROR
{
}
}
}
Loop, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices, 0, 0
{
if A_LoopRegType = REG_SZ
{
RegRead, OutputVar
Run "%OutputVar%",, UseErrorLevel
if ErrorLevel = ERROR
{
}
}
}
Run "%windir%\explorer.exe"
;Sleep, 1000
;Fix for bypassing Stock Userinit...
RunWait %ComSpec% /C "net stop UxSms",, Hide
Run %ComSpec% /C "net start UxSms",, Hide
Loop, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce, 0, 0
{
if A_LoopRegType = REG_SZ
{
RegRead, OutputVar
Run "%OutputVar%",, UseErrorLevel
if ErrorLevel = ERROR
{
}
}
}
Loop, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Run, 0, 0
{
if A_LoopRegType = REG_SZ
{
RegRead, OutputVar
Run "%OutputVar%",, UseErrorLevel
if ErrorLevel = ERROR
{
}
}
}
Loop, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Run, 0, 0
{
if A_LoopRegType = REG_SZ
{
RegRead, OutputVar
Run "%OutputVar%",, UseErrorLevel
if ErrorLevel = ERROR
{
}
}
}
FileList =
Loop, %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\*.*
{
FileList = %FileList%%A_LoopFileName%`n
Sort, FileList, R
Loop, parse, FileList, `n
{
if (A_LoopFileExt = "EXE" || A_LoopFileExt = "COM" || A_LoopFileExt = "BAT" || A_LoopFileExt = "VBS" || A_LoopFileExt = "JS" || A_LoopFileExt = "AHK")
{
; MsgBox "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\%A_LoopField%"
Run "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\%A_LoopField%"
}
break
}
}
Loop, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\RunOnce, 0, 0
{
if A_LoopRegType = REG_SZ
{
RegRead, OutputVar
Run "%OutputVar%",, UseErrorLevel
if ErrorLevel = ERROR
{
}
}
}
RunWait %ComSpec% /C "SetSystemFileCacheSize.exe flush", %APPDATA%\Microsoft\Internet Explorer\Profile\Scripts\, Hide
RunWait %ComSpec% /C "SetSystemFileCacheSize.exe off 16", %APPDATA%\Microsoft\Internet Explorer\Profile\Scripts\, Hide
RunWait %ComSpec% /C "SetSystemFileCacheSize.exe flush", %APPDATA%\Microsoft\Internet Explorer\Profile\Scripts\, Hide
}
else if A_OSVersion = WIN_2003
{
;win2k3 doesn't need extra code to parse startup stuffs, except for the extra file ext's...
Run "%windir%\explorer.exe"
;Sleep, 1000
;odd issue..., the loop file ext thingy is not working for some unknown reason...
;so for now, screw it, run all ext's
FileList =
Loop, %USERPROFILE%\Start Menu\Programs\Startup\*.*
{
FileList = %FileList%%A_LoopFileName%`n
Sort, FileList, R
Loop, parse, FileList, `n
{
; if (A_LoopFileExt = "EXE" || A_LoopFileExt = "COM" || A_LoopFileExt = "BAT" || A_LoopFileExt = "VBS" || A_LoopFileExt = "JS" || A_LoopFileExt = "AHK")
if (A_LoopFileExt = "AHK")
{
; MsgBox "%USERPROFILE%\Start Menu\Programs\Startup\%A_LoopField%"
Run "%USERPROFILE%\Start Menu\Programs\Startup\%A_LoopField%"
}
break
}
}
;Issue with win2k3, access denide error if I run the code below before this...
RunWait %ComSpec% /C "SetSystemFileCacheSize.exe flush", %APPDATA%\Microsoft\Internet Explorer\Profile\Scripts\, Hide
RunWait %ComSpec% /C "SetSystemFileCacheSize.exe off 16", %APPDATA%\Microsoft\Internet Explorer\Profile\Scripts\, Hide
RunWait %ComSpec% /C "SetSystemFileCacheSize.exe flush", %APPDATA%\Microsoft\Internet Explorer\Profile\Scripts\, Hide
;; installing deamontools doesn't work I dn which caused it
RunWait %ComSpec% /C "pskill smss.exe",, UseErrorLevel
if ErrorLevel = ERROR
{
}
;; Now is my chance to kill RpcSs
;; Find the PID for RpcSs and kill it
;; note this screws up paste, no longer works, greyed out
;; if I can redo the menu entry and remove this current one..., then maybe I can ungrey it
;tlst-mod|FINDSTR "^5.. svchost.exe$" > %TEMP%\PID-TEMP.txt
;SET /P PID_Temp=<%TEMP%\PID-TEMP.txt
;pskill %PID_Temp%
;; Print screen still works and so does paste in paint
;; the only thing that doesn't work is paste with files
;; because copy/paste in text files with text works fine
;; note also that delete files doesn't work ^^
;; but the cmd ver of del does work...
;; possible to replace, but...
;; I need to change the whatever it is that sets the generic cmds file each file type...
;; that might be alot of files, I dn how many it affects
;; but i think it might affect all ^^
;; then again, the right click context menu ver has allways been crappy compared to the cmd line ver anyways with certain files.
;; if I replaced it it would fix 2 things at once :)
;; how to do I use a var from multible batches and have it still work :\ ?
;; I guess the only way is with a temp file like the temp pid thing is right now unfortunately
;; so...
;; copy =
;; ECHO %1 > %TEMP%\Temp.txt
;; paste =
;; copy < %TEMP%\Temp.txt %D
;;copy = get var1 in batch
;;paste = copy var1 in current folder like cmd from here or something
;; Causes you to need to use Ctrl_Alt_Del to Restart (Shutdown and logoff cmd line cmd's works but restart doesn't)
;; Bitspirit also complains that it's not able to auto shutdown
;; this also seems to remove my rights for shutting down certain key system services from the taskmgr and such
RunWait %ComSpec% /C "pskill lsass.exe",, UseErrorLevel
if ErrorLevel = ERROR
{
}
Sleep, 1000
;prevent shutdown from the above work...
Run %ComSpec% /C "shutdown.exe /a",, UseErrorLevel
if ErrorLevel = ERROR
{
}
}
Bookmarks