CTRL-C "copy to clipboard", is there a way to make it a file? and extra question

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nnnmmm
Posts: 184
Joined: 26 Aug 2017 06:11

CTRL-C "copy to clipboard", is there a way to make it a file? and extra question

#1 Post by nnnmmm » 22 Feb 2025 22:19

CTRL-C this "copy to clipboard", is there a way to make (or force CTRL-C) it a file too just by clicking a CTRL-C?
if so then, my TB(DOS True Basic compiler) would be able to include the "file's content" into the TB editor from dosboxx.
if not... i need to disable CTRL-C and replace it with CTRL-C operable UserrMadeClipbpard.exe

next question would be...
is there a command or a way that does like below in windows?
ScreenSaver.exe('dosboxx.exe "double pendulum.exe"')

aGerman
Expert
Posts: 4698
Joined: 22 Jan 2010 18:01
Location: Germany

Re: CTRL-C "copy to clipboard", is there a way to make it a file? and extra question

#2 Post by aGerman » 23 Feb 2025 06:54

To handle the clipboard you need to involve other languages like PowerShell, VBScript or JScript.
viewtopic.php?f=3&t=3058

Furthermore I'm not aware of any command to override Ctrl+C because the keyboard input is send to the application with the keyboard focus. In a Windows environment I can think of a little C application that asynchronously hooks the keyboard. However, I have neither any knowledge nor the possibility to develop something like that for DOS.

nnnmmm
Posts: 184
Joined: 26 Aug 2017 06:11

Re: CTRL-C "copy to clipboard", is there a way to make it a file? and extra question

#3 Post by nnnmmm » 23 Feb 2025 11:26

Clip2TXT.VBS has
Set objHTML = CreateObject("htmlfile")
ClipboardText = objHTML.ParentWindow.ClipboardData.GetData("text")
path = "C:\ZTREE\F9\Clip4TB.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(path, 2, true)
objFile.WriteLine ClipboardText
objFile.Close

in TB(True Basic) in boxx
TB's macro key "CONT+}" invokes a TB's script file "CONT}.TRU"
CONT}.TRU has the TB's command "Include E:\ZTREE\F9\Clip4TB.txt"
it perfectly works in the TB's part

>In a Windows environment I can think of a little C application that asynchronously hooks the keyboard
can i try the application?
i have to try if the hot keyboard could run "CTRL-C plus execute this file "Clip2TXT.VBS"
i just use Autokey to disable a single win-key but i dont know anything else about its syntax. if someone knows, please let me know. {Win+F12} to execute the macro would be fine

thanks for this info, i am getting closer to solve the problem

aGerman
Expert
Posts: 4698
Joined: 22 Jan 2010 18:01
Location: Germany

Re: CTRL-C "copy to clipboard", is there a way to make it a file? and extra question

#4 Post by aGerman » 24 Feb 2025 10:23

can i try the application?
Only if you write such an application :lol: I don't have something like that lying around.

nnnmmm
Posts: 184
Joined: 26 Aug 2017 06:11

Re: CTRL-C "copy to clipboard", is there a way to make it a file? and extra question

#5 Post by nnnmmm » 24 Feb 2025 22:22

Clip2TXT.VBS halts and throws up an error message if the context has any form of picture icons or unicode
next i tried GetClip.exe form the link, it did what Clip2TXT.VBS did the same way but it didnt throw up an error, it gave all it could do. so i chose getclip.

i sent autohotkey's forum my 1st post, but the posting approval has passed over two days, so i would assume that it was not approved.
maybe if someone doesnt mind helping me a little, i would be very appreciated, even though this is DOS forum.

AutoHotkey.exe "1.ahk"
^c::
send, {ctrl down}c{ctrl up}
run "C:\Clip2TXT.VBS"
Return

my question to autokey forum was... if there is a way to get this line {ctrl down}c{ctrl up} to work on the windows default clipboard function?
so that ^c:: is different from {ctrl down}c{ctrl up}.... let's say that that invented syntax would be something like this /Win_defaultl{ctrl down}c{ctrl up}/Win_default
there gotta be a way for macro to do this, DOS TB(True Basic)'s macro does this way.

i am going through the autokey tutorial at the moment, i have one last question..
how can i quit autokey.exe from a batch line?
autokey.exe A1.ahk
autokey.exe A2.ahk
it stacks not is replacing A1
TASKKILL /F /IM AutoHotkey.EXE is this only way?

Post Reply