3

I'm encoding files with following command:

certutil -encode inputFileName encodedOutputFileName

However, this creates a new file on the system. Is it possible to print encoded data on command line and not write to a new file?

phuclv
  • 30,396
  • 15
  • 136
  • 260

1 Answers1

0

Use PowerShell instead

[Convert]::ToBase64String([IO.File]::ReadAllBytes("path\to\file"))

If future PowerShell versions support process substitution like bash (or you have bash on your system) then you can use something like this

certutil -encode inputFile >(/dev/tty)

Currently there may be some workaround to achieve the same purpose. But why do that when both PowerShell and bash already have tools to encode/decode base64 contents?

phuclv
  • 30,396
  • 15
  • 136
  • 260