Command Prompt/Powershell Start with certain conditions
Posted: Jul 19th, ’25, 01:47
Hey Tom or anyone else around these parts that are long time members,
Have a bit of conditional code I'd appreciate help creating. I'm still using the code you, Tom, helped me with a while back where a window appears after a shortcut where I can choose Cmd Prompt or Powershell
Command Prompt:: C:\Windows\System32\cmd.exe
/Powershell:: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
If I can make two changes:
1) Can both Cmd Prompt and Powershell be changed to open at the C:\ directory? Currently opening at the location my portable Fastkeys is located.
2) Can there be a seperate option for both to open and automatically have highlighted text entered into the window? I.e. If i have "johnny" highlighted in a window somewhere, I press the shortcut and it opens the Cmd Prompt or Powershell at C:\johnny?
Thank you much!
Have a bit of conditional code I'd appreciate help creating. I'm still using the code you, Tom, helped me with a while back where a window appears after a shortcut where I can choose Cmd Prompt or Powershell
Command Prompt:: C:\Windows\System32\cmd.exe
/Powershell:: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
If I can make two changes:
1) Can both Cmd Prompt and Powershell be changed to open at the C:\ directory? Currently opening at the location my portable Fastkeys is located.
2) Can there be a seperate option for both to open and automatically have highlighted text entered into the window? I.e. If i have "johnny" highlighted in a window somewhere, I press the shortcut and it opens the Cmd Prompt or Powershell at C:\johnny?
Thank you much!