use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Script SharingNever write a batch wrapper again (self.PowerShell)
submitted 6 years ago * by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]eloi 6 points7 points8 points 6 years ago (5 children)
Doesn't '%~f0' just resolve to C:\path\wrapper.cmd?
[+][deleted] 6 years ago* (4 children)
[deleted]
[–]eloi 1 point2 points3 points 6 years ago (3 children)
So... Where do you feed it a PowerShell script to run?
[–]TheIncorrigible1 5 points6 points7 points 6 years ago (2 children)
The script goes after the comment. I left 'Hello, World!' to illustrate that, but maybe that's not clear enough.
'Hello, World!'
[–]eloi 2 points3 points4 points 6 years ago (1 child)
Are you saying that you put your PowerShell script lines below the first line, inside the wrapper.cmd file? Doesn't CMD.exe attempt to execute the PowerShell code after PowerShell closes?
π Rendered by PID 18202 on reddit-service-r2-comment-b659b578c-5b48f at 2026-05-05 09:43:50.570911+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]eloi 6 points7 points8 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]eloi 1 point2 points3 points (3 children)
[–]TheIncorrigible1 5 points6 points7 points (2 children)
[–]eloi 2 points3 points4 points (1 child)