Batch file for HOME key?

zplugger

New member
Local time
2:44 PM
Messages
8
Is it possible to write batch file to press Home key?,if not is there a way to push Home with a script?

Thanks
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Welcome to the Forums.


Autohotkey

To send Home key when the script is run try this

Code:
#NoTrayIcon
Sendmode Input
Send {Home}
It will send Home to the active window when run, then quit

It can either be run as script or compiled to an exe file.

Edit: AutoHotkey is free by the way.
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Thanks milesahead
tried with no luck,
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Here is what I get

C:\larry\desktop\home.vbs
Line 1
Char:1
Error: Expected statement
Code: 800A0400
Source Microsoft VBScript compilation error
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
It's not VBScript. It's Autohotkey. I provided the link to download it.
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Thanks MilesAhead
this might be over my head a little until I learn.I download program and added new script.Now do I edit the script and clear notepad and paste your script here and save.Then do I compile it? Thanks for hanging in there with me.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
You can use any plain text editor. Notepad is fine. Save the script to a file with .ahk extension. Example home.ahk. Autohotkey comes with help that explains how to run programs.

The thing is when you run this program it will send the home key to the active window as if you pressed it. So, if you are typing in a command prompt to run it, that will be the window that gets the home key sent to it. Probably not what you want. You should spell out more what you want to do with it and why you need the macro.

There are dedicated forms for this already here:
Support - AutoHotkey Community
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Again Thank You for your time
I can not make it work right, by clicking the script I'm not active to the program any more. What I have is a movie list program on my tv which is hooked to my computer. Trying to move around in program with only a wireless mouse,that part works great. There is times when I need to hit home key to default to top of list,with no keyboard thats hard to do.Been using OSK for a work around,but thats a pain all the time.Was hoping for a icon on task bar to do this,not sure how to push the icon and stay active in the program?, not sure this is possible.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
It can be done easily. Just explain what you need on that AHK forum in the link. Something easy like that I'm sure someone will help you out. That's what that forum is for.
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self Built
OS
Windows 8.1 Pro x64
CPU
Intel Core i5-2500K @ 3.30GHz - S1155
Motherboard
Asus P8P67 LE Rev3, Intel P67, S115
Memory
8GB Corsair DDR3 XMS3, PC3-12800
Graphics Card(s)
NVIDIA GeForce GTX 650
Sound Card
On-Board
Monitor(s) Displays
3 x 24" {Extended Display}
Screen Resolution
1920 x 1080
Hard Drives
300GB Seagate Barracuda 7200
PSU
550W Coolermaster GX550
Case
Silverstone Precision PS04B
Cooling
Stock
Keyboard
Logitech K120
Mouse
World of Warcraft Cataclysm MMO Gaming Mouse
Internet Speed
80 MB
Antivirus
MSE / Windows Defender
Browser
Chrome
Back
Top