Webocreation

Tuesday, June 30, 2009

useful tipos and tricks for batch file

Fast Shut Down
Windows XP
1. Go to Start and click on run
2. In the blank Field type Regedit hit the enter button
3. Now expand HKEY_LOCAL_MACHINE
4. Expand SYSTEM
5. Expand ControlSet003
6. Now click on Control DO NOT EXPAND
7. On the right side click on WaitToKillServiceTimeout
8. Has default it should be set to 20000 (this means that it would Shutdown in around 20 seconds)
9. Set it to 5000 (This should cut down your shutdown time)

Windows Vista
1. Go to Start and type Regedit and hit the enter button
2. A Windows needs your Permission to continue should prompt up
3. Click continue Registry Editor should come up
4. Now expand HKEY_LOCAL_MACHINE
5. Expand SYSTEM
6. Expand ControlSet003
7. Now click on Control DO NOT EXPAND
8. On the right side click on WaitToKillServiceTimeout
9. Has default it should be set to 20000 (this means that it would Shutdown in around 20 seconds)
10. Set it to 5000 (This should cut down your shutdown time)

Change Drive Name Through Batch File

1. Login to the PC you are wanting to change the drive letter for.
2. Create a new batch file by right clicking on your desktop and selecting New->Text File. Rename the file to whatever you want but make sure the file extention is .bat.
3. Right click on the file you created and select edit.
4. Place the following code in the file and save. This code will delete the existing drive mapping and move it to another drive letter.
net use /delete
net use \\server\share
5. Double click the saved file and you should see the DOS screen flash. Check to make sure your drive has changed.
How to Write a Batch File
Writing a batch file is used to automate daily and often mundane tasks. Instead of typing the same commands day after day, you would simply double click the batch file to run said commands. These instructions will show you how to do so.
Steps
For Windows
1. Open up Notepad in Windows. You can do this by navigating to Start > Programs > Accessories > Notepad, or simply by entering notepad under Start > Run.
2. Or open up notepad by C:\WINDOWS\system32\notepad.exe
3. Save your file before anything, so be sure to follow the instructions closely.
1. Go to File > Save As... and chose a file name.
2. Choose your desktop as the location to save, for now. Don't click Save just yet.
3. Click on the dropdown menu next to "File name". Select "All files" instead of Text Document".
4. Add .bat to the end of your file name before you save. For example, you would type example.bat.
5. Click on Save. If you did this correctly, you should see your file name in the title of Windows Notepad. Make sure that it reads as example.bat—not example.bat.txt. Now you are ready to create your batch file.
4. Type "@echo off" on the first line of your batch file. This will prevent any spaces in the batch file to be read by the program when executed.
5. Enter your commands. The following example below will show you how to create a batch file that will automatically load wikiHow.com using Internet Explorer.
o @echo off.
o REM The following will open wikiHow.com in a new Internet Explorer window.
o "start Iexplore.exe www.wikihow.com"
o REM The following will open wikiHow.com in your default browser, but if it is IE and you have another IE window open, then it will hijack that window.
o "start www.wikihow.com"
6. Save the file by going to "File>Save" and type in "wikihow.bat".
7. Run the file by double clicking the file on your desktop.

[edit] Tips
• You can use third party editors such as UltraEdit to edit your batch file. But for the most part, these are a waste of time when writing simple batch files.
• Make sure not to enter any quotes used above. Those are simply to help distinguish the command, filename, and file extension.
• You will have to use quotes if you want to open a directory or file with spaces in its name, like start "C:\Documents and Settings\"
• You must click "Save as" and change ".txt" to "All files" in the file type drop-down menu. Then, add ".bat" to your file name instead of ".txt".
• When saving the batch file, type the filename as "filename.bat" without quotation marks, and it's not necessary to select "All Files".
• Batch files can also have a .cmd extension beginning with Windows 2000. There is no difference in operation, but the .cmd files use 32-bit execution while the .bat files use 16-bit execution.



Black Screen prank
1. Open the registry file. Click on the "Start" menu, select "Run", and type in REGEDIT. Click on "Ok" or press [Enter].
2. Navigate to "HKEY_CURRENT_USER\Control Panel\Colors". These give the RGB values for the color of each Windows' component. These will show all of the color values, many of which are not available through the Windows GUI (from "Appearance" tab in "Display Properties").
3. Change each value. The "Data" column holds the RGB value for all component shown here. For each listing that is not set to "0 0 0" in the "Data" column, double-click on it and change it to 0 0 0 with spaces between the zeros. Then click "Ok" or press [Enter].
4. Close the Registry Editor.
5. Restart the computer.


How to Make a Fake Error Message on Windows
This is just a funny prank to pull on your friends using VBScript. You make a fake error message that has a message on it.
Steps

1. Open Notepad. The quickest way is to press WIN-R, and type "notepad.exe" without the quotes.
2. Copy and Paste the following code:lol=msgbox("Your Message Here",16,"Your Title Here")
3. Change Your Message Here to a message, and change Your Title Here to whatever you want to show on the Title Bar. I recommend using Error as a title.
4. Go to File-Save as... and select All Files in the Save as type: and save the file as *.vbs and you're all done!
5. Just double-click on the .vbs file and the error will pop up!

1 comment:

  1. Hi Rupak. Wow! you're into computers and I'm at a lost. But I'm interested with your tricks and I wanna try them. Won't these tricks affect my files? I'm now following you. Hope you follow me too.

    ReplyDelete