Forum Thread: How to Run a Powershell Command When a File Is Opened

I would like a single PowerShell command to run when my file is opened without a powershell windows being shown.

(similar to the DDE tutorial on here but for powershell rather than CMD and I would like to be able to add it to any file not just microsoft office files)

1 Response

You can use Cmd to open and run powershell scripts.

You should be able to create a text file with
c:\\windows\\system32\\cmd.exe powershell script
And save it with a cmd file extension.

Share Your Thoughts

  • Hot
  • Active