Wednesday, October 09, 2013

Useful windows command line tips

Some powerful things you can do using windows command line:

1. Create Large Dummy file - 50MB
C:\>fsutil file createnew test.txt 50000000

2. Create a Large file with Real Data - 1GB
C:\>echo "This is just a sample line appended to create a big file " > dummy.txt
C:\>for /L %i in (1,1,24) do type dummy.txt >> dummy.txt

If you increase the bold number by 1, you can double the size of the file. If you decrease it by 1 you will reduce the file size by half.

3.To add a domain user to local administrator group:
C:\>net localgroup administrators domainname\username /add

4. Get mac address of local computer

Get Mac address of remote computer
C:\>getmac /s remote_computer /u username /p password

5. Take ownership of a file/folder from windows command line?
c:>takeown /R /F c:\windows\csc\
SUCCESS: The file (or folder): "c:\windows\csc\" now owned by user "domain\user".

6. Find BIOS version
c:\>systeminfo | findstr /C:BIOS

7. Find memory size
c:\>systeminfo | findstr /C:"Total Physical Memory"
or run c:\> wmic memorychip get capacity

No comments: