Windows server 2003 and Windows XP – How to use advanced search for files via command line

Posted by aidas | Posted in Command line, Tools, Windows 2003, Windows XP | Posted on 13-08-2009

0

Windows server 2003 has very nice tool “forfiles.exe” which provides you with quick and nice file search function.

If you want to use it with your Windows XP machine download it from here .

This tool can be played with mass of functions and in this article i`ll show how to use it with some of them.

For example i want to search through all *.log files in C:\Windows folder and subfolders.

If i find any *.log file there that size is greater than 1MB i want to export  path, size and modify time information of that file into C:\Data\LogFileInfo.txt .

In that case open command line and type:

forfiles.exe /p C:\Windows /s /m *.log /c “cmd /c IF @fsize GTR 1000000 (echo @path @fsize @fdate)” >C:\Data\LogFileInfo.txt

Syntax:

/p – what path to search
/m – what file type to search
/s – include subfolders
GTR – greater than

Windows server 2003 and Windows XP – How to redirect offline files to another server

Posted by Mark | Posted in Command line, Tools, Windows 2003, Windows XP | Posted on 05-08-2009

0

Few weeks ago i got tough situation when share i made offline was moved to another server by local administrator and all users were still trying to synchronize offline files with old server.

How to act in this situation You would ask?

First of all you must download Windows server 2003 Resource Kit Tools from this site .

In this case we will need csccmd.exe tool which will work on Windows XP systems too.

Install tools pack you downloaded, open command line and navigate to Resourse Kit Tools folder.

When you are in place type:

csccmd.exe /moveshare:\\oldserver\oldshare \\newserver\newshare

offlinefiles

Press “Enter” and you are done !

Windows XP – How to add Command Prompt to Windows explorer right-click menu

Posted by Mark | Posted in Command line, Windows XP | Posted on 24-07-2009

1

This post will show you how to add functionality to right click on any directory and select “Command Prompt Here” from the menu to open command line in that location.

First of all open registry editor Start > Run, type regedit and press OK.

Browse to:

HKEY_CLASSES_ROOT\Directory\shell

regedit1

Right click “shell” and choose the New > Key option

regedit2

Name the new key  “CommandPrompt” without the quotes and then double-click on the default value in the right .

Change value data to “Command Prompt Here”

regedit3

Right click on the key you created and select New > Key

regedit4

Name the new key “Command” and then double-click the default value on the right.

Set Value data to:

cmd.exe /k cd %1

regedit5

Press “OK” .

Now when you right-click any folder in your Windows machine you will see “Command Prompt Here” option to open command line in that location.

regedit6

Cheers!

Windows XP secrets – How to find hidden Brian Eno Ambient MIX !

Posted by aidas | Posted in Windows XP | Posted on 22-07-2009

0

Hi there!

Check this nice hidden Brian Eno Ambient mix in your Windows XP machine ! :)

To access it Press Start > Run and type:

C:\WINDOWS\system32\oobe\images\title.wma

hidden

Press “OK” and Enjoy ! :)

Windows server 2003 and Windows XP – How to script file download from FTP server

Posted by Mark | Posted in Scripting, Windows 2003, Windows XP | Posted on 22-07-2009

1

Do you know how to script basic  FTP server connect/copy operations?

I`ll show you that.

Lets assume you want every Friday at 06:00pm to connect to specific FTP server and download all files from it to directory named D:\Scanfiles.

On your Windows server 2003 or Windows XP start notepad and type:

@echo off
echo user username> ftpbat.dat
echo password>> ftpbat.dat
echo prompt>> ftpbat.dat
echo mget *.*>> ftpbat.dat
echo quit>> ftpbat.dat
ftp -n -s:ftpbat.dat FTPserverIP
del ftpbat.dat

notepad

Save file as ftp.bat and place it in D:\Scanfiles folder.

Change this data:

username – your ftp username
password – your ftp password
FTPserverIP – ip address of ftp server to connect

After that create new scheduled task to run ftp.bat file every Friday at 06:00pm .

Cheers! :)

Windows server 2003 and Windows XP – How to delete files when path is too long

Posted by Erica | Posted in Tools, Windows 2003, Windows XP | Posted on 09-07-2009

0

I hate this one really…

Then path to file exceeds 255 symbols it becames corrupted and you can have very hard time to delete or rename it.

Ok, how to deal with this.

At this case you have three choices:

1. Dont use too long paths! Use short names for you folders and avoid naming folders this way:

“Very important documents for financial department that were copied from local storage at 20080607″

2. If you did already,  you can try to follow path to file and try to rename some very long folder names to shorter one.

3. You can use third party software that will run on your Windows server 2003, Windows XP and even older machines to deal with these files.

One of really great and free utils is “DelinvFile”.

You can download it from here .

Windows server 2003 and Windows XP – How to shedule disk defragmenting

Posted by Mark | Posted in Scripting, Windows 2003, Windows XP | Posted on 07-07-2009

0

I`ll show you how to create very nice .bat script which will defragment your disks and generate report in log file.

This script was tested on Windows server 2003 or Windows XP machines.

Ok then, lets say you want to defragment C: and D: disks every Monday and Friday starting job at 10:00pm.

Also you want to store log file on C:\Tools folder.

OK, lets open notepad and copy paste this text:

@Ecxo off
Set logfile=C:\Tools\defrag.log
Echo Start %date%,%time% >>%logfile%
Echo *************************** >>%logfile%
Echo Defragmenting C: disk >>%logfile%
Echo. >>%logfile%
defrag.exe c: -f >>%logfile%
Echo *************************** >>%logfile%
Echo Defragmenting D: disk >>%logfile%
Echo. >>%logfile%
defrag.exe d: -f >>%logfile%
Echo *************************** >>%logfile%
Echo Finished %date%,%time% >>%logfile%
Echo *************************** >>%logfile%

Save this file as Defrag.bat and place it to C:\Tools folder

Now open command line and shedule defragmenting by typing:

at 10:00pm /every:M,F C:\Tools\Defrag.bat

defrag

Press “Enter”

And we are finished !

Windows server 2003 and Windows XP – How to create “dummy” file via command line

Posted by Mark | Posted in Command line, Windows 2003, Windows XP | Posted on 02-07-2009

0

Here is quick tip how to create dummy file with size of your choice using Windows server 2003 or Windows XP machine.

To do that i will use utility named “fsutil”. Basic syntax for creating a file is:

fsutil file createnew <name of file> <size in bytes>

For example following command:

fsutil file createnew C:\dummyfile.txt 1000000

fsutil

will create 1Mb file named dummyfile.txt in C:\

Windows – How to spy on Windows users

Posted by Erica | Posted in Windows 2003, Windows 7, Windows Vista, Windows XP | Posted on 26-06-2009

0

This post will show you how to spy on other users using Windows computer.

For this purpose we tested software named “Detective Dominator”.

“Detective Dominator” is a stealth keylogger that will provides you  with necessary confidence in monitoring PC and internet activity.  Whether you want to monitor your computer while you are away, retrieve lost information, or monitor your children’s activity it is really nice keylogger software for the job.

keyloger

If you have your own business this tool can help you for the perfect employee monitoring software.  As per developer this software for pc usage monitoring allows you to find out virtually everything that happens on the computer…

If you are interested read more about “Detective Dominator”  Here .

Windows server 2003 and Windows XP – How to reset scheduled check disk (CHKDSK)

Posted by aidas | Posted in Windows 2003, Windows XP | Posted on 23-06-2009

0

Two days ago i have encountered following situation.

I have scheduled check disk for C: drive via command line on my Windows server 2003 because it was spitting some strange errors in event log about inconsistency of logical drive.

To check C: drive i have opened command line and typed:

chkdsk C: /f /r

to check logical disk,  locate bad sectors and recover any readable information if needed

After this i was asked if i want to schedule this procedure run after next restart as it cant perform this on running system.

I confirmed that by typing Y.

One hour after i foung buggy software that was the source of errors in event log and CHKDSK i scheduled earlier bacame needless.

After some googling i have found the way you can reset scheduled CHKDSK task.

For that you must open registry by typing regedit in command line.

Navigate to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager

Can you see BootExecute string in there. I bet you do!

Open it and clear all value data by leaving only autocheck autochk *

regedit chkdsk windows

Registry editor BootExecute string

And… press OK. After this registry editing your CHKDSK sheduled task will be canceled.

Thats it !

Windows – How to reset local user password to random one

Posted by Thomas | Posted in Command line, Windows 2003, Windows XP | Posted on 22-06-2009

0

This post will show you how to randomly reset local user password on you Windows machine using command line.

Lets say we have local user named “testuser” and we want randomly reset its password.

For this press Start>Run, type CMD and press “OK” .

In command line type:

net user testuser /random

random_password

Press “Enter”.

Password will be reseted and it will be shown to you after you pressed “Enter” button.

The output will be similar to:

random_password2

Good job!

Windows XP – How to edit remote access to the registry

Posted by aidas | Posted in Registry, Windows XP | Posted on 19-06-2009

0

This post will show you how to edit remote access to the registry settings.

To make changes press “Start” then “Run” and type regedit.

In registry editor navigate to:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServer\winreg

registry

Security permissions that are set on key “winreg” controls who can access registry remotely.

If you want to change current settings right click “winreg” key and choose Permissions.

In this “Permissions for winreg” window you can set who will be able to access registry remotely.