Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

I have been using Powershell for around 6 months now i'm i'm really loving it.

The 'power' it has (excuse the pun) is great.

However, i've recently been looking at updating our scripts to install older printers that wont push via GP.

 

We used to copy a .txt file to a folder on C: and use IF EXIST DO etc... to see if the printer was there.

 

Now with powershell and WMI i am checking to see if the printer is there which is great.

 

But upon looking to actually install the networked printer and drivers, powershell seem to require quite a bit of code to do this.

 

now i can just run something like

 

cmd /c 'rundll32 printui.dll,PrintUIEntry /if /b "Maths Laser" /f "\\print\Drivers\Brother - HL-5240 5250N\BROHL05A.inf" /r "\\Office\Laser" /m "Brother HL-5240 series"'

 

which will do it in 1 line...

 

However, i feel like a traitor.

Is it better to use powershell exclusively, or save time and lines of code and send a command to the cmd.exe?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...