Pasting Commands from Excel to PowerShell: How to Fix the Prefix Issue?

0
7
Asked By StellarRaccoon99 On

I've been using Robocopy to move certain files to different destination folders. Since the files and destinations change frequently, I've been tweaking the commands in Excel to streamline the process. This worked perfectly in Windows 10, but after our upgrade to Windows 11, a weird issue popped up. Whenever I paste the commands into PowerShell or CMD, each pasted command gets this annoying prefix – it looks like ".cisco(ps)" or ".cisco(cmd)". Does anyone know how to turn off this auto-prefix behavior? I'm also exploring the idea of using Excel VBA to create a button or macro to run these commands directly. Any help would be appreciated!

5 Answers

Answered By CommandLineHero On

The issue might be that you accidentally tab-complete when you paste. It might help to try pasting in Notepad first to see if the tab characters are causing issues. Also, perhaps explore unbinding the Ctrl+V pasting in the new terminal so that PowerShell can handle it better like it did before in the old console.

RoboGuru88 -

I think you're right about the accidental tab completion. Using Notepad as a middleman could really simplify the paste process.

Answered By CloudyNinja84 On

It sounds like you're dealing with some clipboard weirdness. You might need to share a screenshot just to clarify. It could be that there are too many layers involved—Windows, Excel, the shell, etc. It's hard to pinpoint the exact cause without more context.

Answered By TechyExplorer23 On

Using Excel as your IDE is pretty wild! Just a heads up, have you considered using plain text instead? Sometimes, removing complicating factors helps. Try storing your paths in plain text or using a CSV file to avoid those pesky tab characters when copying. You could then read from that in PowerShell without any extra fuss!

Answered By InnovativeScripter On

If you haven’t checked out the ImportExcel module for PowerShell, it’s worth a look! It allows you to create and read spreadsheets without needing Excel, plus it simplifies your scripting process.

Answered By SimplicityWins On

You could totally ditch Excel for this! Instead, try writing a PowerShell script. It's usually way easier than using Excel for this kind of task and will save you the hassle of those prefixes.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.