# How to make batch file?



## mayoorite (Aug 15, 2011)

Hi!
I need help to make a batch file to run "ctrl+alt+right arrow". or to rotate screen.
Please reply.


----------



## abhijangda (Aug 16, 2011)

Which OS?


----------



## Vyom (Aug 16, 2011)

@OP: I can't say if you can create a batch file for this purpose, but you can make a simple VB script to the same purpose, and call that from a batch file. (Assuming you are using Windows XP).

If you want to create the script, following would be the best page to do that:
Microsoft Windows 2000 Scripting Guide - Sending Keystrokes to a Program

Tell me, if you were unable to make it, since I got successful in making one.


----------



## Anorion (Aug 16, 2011)

just save the extension as .bat in ur text editor


----------



## Vyom (Aug 16, 2011)

@Anorion: If speaking to OP, then I really thinks he know how to make a batch file, what he may not know are commands to execute to invoke that shorcut.
If you were referring to me, then.. thanks, I would try renaming .vbs to .bat to create a batch file from vbs script file.

Edit: No It doesnt work that way. :S


----------



## mayoorite (Aug 16, 2011)

vineet369 said:


> @OP: I can't say if you can create a batch file for this purpose, but you can make a simple VB script to the same purpose, and call that from a batch file. (Assuming you are using Windows XP).
> 
> If you want to create the script, following would be the best page to do that:
> Microsoft Windows 2000 Scripting Guide - Sending Keystrokes to a Program
> ...


I will try and reply in one or two days.


----------



## Anorion (Aug 16, 2011)

yeah its overkill for a batch file, but I was just answering OPs question
the vbs can be added to a batch file using


```
@echo off
start c:\keystrokes.vbs
```

orr add the .vbs directly to the registry or startup folder


----------

