How to run a program and copy text to the clipboard Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Moaz93
Posts: 2
Joined: 05 Aug 2018, 12:32

How to run a program and copy text to the clipboard

05 Aug 2018, 12:48

Hi everyone,
I'm running a program that requires me to enter a Serial number every time I start it (it's not a bug). So can i start it and automatically copy my SN to the clipboard so I can paste it right away?

any way I use this .bat file:
@echo off
start "Program" "C:\Program Files\program\program.exe"
start "SN" "C:\Program Files\program\Serial number.txt"

so it opens the text file and the program, but I want to copy it right away without having to switch to the text file and close it

However, the program for some reason disappears after the splash screen, but when I run it from the shortcut or the start menu it starts normally, I think it's the batch file issue....

So, can I make an exe file that launches the program and copy the serial number (XXXXXX) to the clipboard? is it possible and how please?

thanks.
Rohwedder
Posts: 1430
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to run a program and copy text to the clipboard  Topic is solved

06 Aug 2018, 00:21

Hallo,
try this:

Code: Select all

Run, C:\Program Files\program\program.exe
FileRead, Clipboard, C:\Program Files\program\Serial number.txt
or that:

Code: Select all

Run, C:\Program Files\program\program.exe
Clipboard = XXXXXX
Moaz93
Posts: 2
Joined: 05 Aug 2018, 12:32

Re: How to run a program and copy text to the clipboard

17 Aug 2018, 08:44

SORRY FOR THE LATE REPLY
thank you soooo much my friend, you saved my day!
It worked!

Return to “Ask For Help”

Who is online

Users browsing this forum: CyL0N, Google [Bot], John316, loek3000, Mipha, Ravenlord, tonkomnom and 53 guests