making a bat file, rookie needing help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
skaar
Posts: 1
Joined: 14 Apr 2016 03:53

making a bat file, rookie needing help

#1 Post by skaar » 14 Apr 2016 03:57

so, im trying to get this command to run in cmd-powershell.

comman being
get-psdrive | Where Free*

currently I can get to the powershell inside cmd using this

echo
title PC INFO SCRIPT
:prompt
color 1f
cls
echo PC INFO SCRIPT
echo.
cd\
cd\
powershell

but I have no idea how to make it run my command - get-psdrive | Where Free*
would appreciate a hand, thanks :)

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: making a bat file, rookie needing help

#2 Post by Squashman » 14 Apr 2016 06:27

This is the basic syntax for using Powershell in a batch file.

Code: Select all

powershell -command "get-psdrive"

Post Reply