Command Prompt Cut and Paste

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3460
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Command Prompt Cut and Paste

Post by JRL » Mon Aug 29, 2022 6:46 pm

Not sure when this newfangled Microsoft magic started.

I'm forever highlighting text in a Command Prompt window and instead of pressing "Enter" to place it in the clipboard, I accidentally press "Ctrl + c". This of course fails miserably... until today.

Today, quite by accident, I discovered that Command Prompts now accept text pasted using "Ctrl + v" and will copy highlighted text using "Ctrl + c". In case you're wondering, "Ctrl + x" still puts "^X" on the screen.

For anyone wishing to send text via Macro Scheduler script, especially special characters, to a command line in an already open Command Prompt window, using the clipboard and "Ctrl + v" will make things much easier than trying to use SendText> and getting mixed results. (In my experience, "Send>:" almost always sends ";" to a command line)

My current Win 10 version = 21H2 build 19044.1889

Hope someone, someday finds this useful,
Dick

User avatar
JRL
Automation Wizard
Posts: 3460
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Command Prompt Cut and Paste

Post by JRL » Wed Aug 31, 2022 8:04 pm

Apparently there is more to it than the OS version. I'm currently using a different computer that I thought was fully updated and is in fact the same Win 10 version = 21H2 build 19044.1889 when I view the data under "About Your PC". However, I can't cut / paste using "Ctrl + c / v" from a Command Prompt on this computer.

The PC where it works is a 2 month old computer and is Windows 10 Enterprise. The PC where it fails was shipped Oct of 2014 according to the Dell service tag information and the OS is Windows 10 Pro. I bought this computer new.

I'll do a little more investigating and see if I can discover the method for turning this feature on. I want it even if no one else cares.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1106
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Command Prompt Cut and Paste

Post by Dorian (MJT support) » Thu Sep 01, 2022 8:57 am

I seem able to paste into (ctrl-v) and copy from (ctrl-c) the command prompt on both my Win10 and Win11 systems. I do remember not being able to do this a long time ago.

Windows 10 Home
21H2 19044.1889
Windows Feature Experience Pack 120.2212.4180.0
Command Prompt first line : Microsoft Windows [Version 10.0.19044.1889]

Windows 11 Home
21H2 22000.856
Windows Feature Experience Pack 1000.22000.856.0
Command Prompt first line : Microsoft Windows [Version 10.0.22000.856]

EDIT : I found a setting : right-click on the Command Prompt title bar. Choose "Properties". Enable "Enable CTRL key shortcuts"
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
JRL
Automation Wizard
Posts: 3460
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Command Prompt Cut and Paste

Post by JRL » Thu Sep 01, 2022 11:35 am

Yes, I know about the setting. I have 4 Win 10 computers at my desk at work. All at the same update level, none have that checkbox checked. three of them can cut and paste, one cannot.

Is the checkbox checked on your's?

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1106
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Command Prompt Cut and Paste

Post by Dorian (MJT support) » Thu Sep 01, 2022 12:12 pm

Aaah, I thought I'd found some magic. :D

That setting is available on both of mine.

I noticed some of the settings (including that one) grey out if you check "Use legacy console" at the bottom though.

Edit : PS.. if I uncheck it and try to paste, I get ^V instead,
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
JRL
Automation Wizard
Posts: 3460
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Command Prompt Cut and Paste

Post by JRL » Thu Sep 01, 2022 3:32 pm

I'm wondering if mine work because of a corporate initiated group policy. I could ask but I've never received a response to any email where I've requested info about group policy implementation.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts