PowerISO - Parameters Command Line

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
CZ.M
Junior Member
Junior Member
Posts: 18
Joined: 2016-11-04, 17:53 UTC

PowerISO - Parameters Command Line

Post by *CZ.M »

Hi
I use PowerISO. I've added a button to the toolbar TC that creates an image file or folder. Creating an image of a single file or folder works great.
my parameters is
Command: piso.exe
Parameters: create -o "%O.iso" -add %N \
Command Line syntax is here

Code: Select all

http://www.poweriso.com/tutorials/create-iso-file-from-command-line.htm
The problem is that I would like add set of selected files or folders to image. Everything works great but for individual files or folders, but unfortunately it does not work on a group of files or folders. For a group of files or folders I tried many combinations but unfortunately nothing works.
eg.
create -o image.iso -add %S \
And many other parameters

Can you help me with this problem? :idea:
#226365 User License
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

CZ.M wrote: but unfortunately it does not work on a group of files or folders. For a group of files or folders I tried many combinations but unfortunately nothing works.
I think for this program it can be possible only via (ahk or vbs or ps and so on) script, because "-add" parameter must be inserted before each file/folder name and "/" must be added at the end of each file/folder name.

I can try to write a script, but not fast, by the presence of free time
Last edited by Ovg on 2016-11-26, 10:29 UTC, edited 1 time in total.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2CZ.M

Which name do you want to use for resulting image in case of multiply files/folders?
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
CZ.M
Junior Member
Junior Member
Posts: 18
Joined: 2016-11-04, 17:53 UTC

Post by *CZ.M »

Ovg wrote: Which name do you want to use for resulting image in case of multiply files/folders?
Thank You for Your replay.
BTW
If it is a lot of work with this, just do not do it.

The name may be just "image". If I need to change the image name, I will do this by modifying the script. Of course, if I could do it.
Best regards
#226365 User License
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2CZ.M

Compiled Script: http://rgho.st/6ydNnWjdT
Button:

Code: Select all

TOTALCMD#BAR#DATA
Create_Image.exe
%PImage.iso %P%S
Path to your Icon file
Create_Image
Directory where piso.exe resides
1
-1
%PImage - path and name your image file, change for your taste.
%P%S - full names selected files for adding to image
Path to your Icon file - your icon for this button, change to actual icon
Directory where piso.exe resides - write here actual path to piso.exe
Last edited by Ovg on 2016-11-26, 14:35 UTC, edited 1 time in total.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
Skif_off
Member
Member
Posts: 132
Joined: 2013-09-30, 13:13 UTC

Post by *Skif_off »

2CZ.M
Maybe VBScript

Code: Select all

' Command:    "path2script\PowerISOCreate.vbs" "path2PowerISO\piso.exe"
' Parameters: "%T" "%L"

If WScript.Arguments.Length <> 3 Then
  WScript.Echo "Check startup parameters!"
  WScript.Quit
End If

Dim sIsoName, sCmdLine, Str

sIsoName = InputBox("Enter name", "ISO name", "image")
If IsEmpty(sIsoName) Then
  WScript.Quit
End If

sCmdLine = """" & WScript.Arguments.Item(0) & """ create -o """ & WScript.Arguments.Item(1) & sIsoName & ".iso"""

Set WshShell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objRegExp = CreateObject("VBScript.RegExp")
objRegExp.Pattern = "\\$"

Set File = FSO.GetFile(WScript.Arguments.Item(2))
Set TextStream = File.OpenAsTextStream(1)
Str = vbNullString
While Not TextStream.AtEndOfStream
    Str = Str & " -add """ & objRegExp.Replace(TextStream.ReadLine(), "") & """ /"
Wend
TextStream.Close

WshShell.Run sCmdLine & Str, 1, False
?
Save as PowerISOCreate.vbs and

Code: Select all

Command:    "path2script\PowerISOCreate.vbs" "path2PowerISO\piso.exe"
Parameters: "%T" "%L"
ISO-file will be created in a target panel.
User avatar
CZ.M
Junior Member
Junior Member
Posts: 18
Joined: 2016-11-04, 17:53 UTC

Post by *CZ.M »

2Ovg and Skif_off
I tested both solutions and both work. I have only one objection. When you add entire folders to the image, is not preserved directory structure. Added are only the same files from the directories. All directories are added only when they are located as sub directories.

Thank you very much for your help :D
#226365 User License
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

CZ.M wrote:is not preserved directory structure. Added are only the same files from the directories. All directories are added only when they are located as sub directories.
I have noticed this issue, but I don't know how to avoid it. I didn't find command or switch which is responsible for this.

Do you need in source code of my script? I can upload it to somewhere.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
CZ.M
Junior Member
Junior Member
Posts: 18
Joined: 2016-11-04, 17:53 UTC

Post by *CZ.M »

Ovg wrote: Do you need in source code of my script? I can upload it to somewhere.
No, thank you, maybe someone else having a look here and will have an idea.
Best Regards
#226365 User License
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2CZ.M

IMHO there is a bug in command line version of PowerISO ...
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
Skif_off
Member
Member
Posts: 132
Joined: 2013-09-30, 13:13 UTC

Post by *Skif_off »

2Ovg
No, it's not bug, try:

Code: Select all

piso create -o "d:\test.iso" -add "d:\test\folder" "/"
piso create -o "d:\test.iso" -add "d:\test\folder" "/folder"

2CZ.M
Try this script

Code: Select all

' Command:    "path2script\PowerISOCreate.vbs" "path2PowerISO\piso.exe"
' Parameters: "%T" "%L"

If WScript.Arguments.Length <> 3 Then
  WScript.Echo "Check startup parameters!"
  WScript.Quit
End If

Dim sIsoName, sCmdLine, Str, Str2

sIsoName = InputBox("Enter name", "ISO name", "image")
If IsEmpty(sIsoName) Then
  WScript.Quit
End If

sCmdLine = """" & WScript.Arguments.Item(0) & """ create -o """ & WScript.Arguments.Item(1) & sIsoName & ".iso"""

Set WshShell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objRegExp = CreateObject("VBScript.RegExp")
objRegExp.Pattern = "\\$"

Set File = FSO.GetFile(WScript.Arguments.Item(2))
Set TextStream = File.OpenAsTextStream(1)
Str = vbNullString
While Not TextStream.AtEndOfStream
  Str2 = TextStream.ReadLine()
  If Right(Str2, 1) = "\" Then
    Str = Str & " -add """ & objRegExp.Replace(Str2, "") & """ ""/" & FSO.GetFileName(Str2) & """"
  Else
    Str = Str & " -add """ & Str2 & """ /"
  End If
Wend
TextStream.Close

WshShell.Run sCmdLine & Str, 1, False
Ok?

P.S. If you want add switches then you can add string before

Code: Select all

WshShell.Run sCmdLine & Str, 1, False
Example: add "-udf on":

Code: Select all

TextStream.Close

Str = Str & "-udf on"
WshShell.Run sCmdLine & Str, 1, False
User avatar
CZ.M
Junior Member
Junior Member
Posts: 18
Joined: 2016-11-04, 17:53 UTC

Post by *CZ.M »

Ovg wrote:2CZ.M
IMHO there is a bug in command line version of PowerISO ...
Maybe you're right.
I tested second program with similar capabilities.

Code: Select all

https://www.ezbsystems.com/ultraiso/
This program has a more extended command line.

Code: Select all

https://www.ezbsystems.com/ultraiso/cmdline.htm
It has a switch that allows you to add entire folders (as opposed to PowerISO)
-file filename Add one file or folder (include folder name and all files and folders under it)
as opposed to
-directory dirname Add all files and folders under given directory (not include directory name itself)
Unfortunately, but I have a problem with setting the parameters
Command: UltraISO.exe
Parameters: -imax -l -f %N -out %P%S.iso
I tried as an administrator but also without success. I tried different variants, and nothing works.
:(
#226365 User License
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2Skif_off
You are right! Bingo!
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2CZ.M
It seems that Skif_off has solved your problem:
http://ghisler.ch/board/viewtopic.php?p=321772#321772
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
CZ.M
Junior Member
Junior Member
Posts: 18
Joined: 2016-11-04, 17:53 UTC

Post by *CZ.M »

Skif_off wrote: Try this script

Code: Select all

' Command:    "path2script\PowerISOCreate.vbs" "path2PowerISO\piso.exe"
' Parameters: "%T" "%L"

If WScript.Arguments.Length <> 3 Then
  WScript.Echo "Check startup parameters!"
  WScript.Quit
End If

Dim sIsoName, sCmdLine, Str, Str2

sIsoName = InputBox("Enter name", "ISO name", "image")
If IsEmpty(sIsoName) Then
  WScript.Quit
End If

sCmdLine = """" & WScript.Arguments.Item(0) & """ create -o """ & WScript.Arguments.Item(1) & sIsoName & ".iso"""

Set WshShell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objRegExp = CreateObject("VBScript.RegExp")
objRegExp.Pattern = "\\$"

Set File = FSO.GetFile(WScript.Arguments.Item(2))
Set TextStream = File.OpenAsTextStream(1)
Str = vbNullString
While Not TextStream.AtEndOfStream
  Str2 = TextStream.ReadLine()
  If Right(Str2, 1) = "" Then
    Str = Str & " -add """ & objRegExp.Replace(Str2, "") & """ ""/" & FSO.GetFileName(Str2) & """"
  Else
    Str = Str & " -add """ & Str2 & """ /"
  End If
Wend
TextStream.Close

WshShell.Run sCmdLine & Str, 1, False
Ok?

P.S. If you want add switches then you can add string before

Code: Select all

WshShell.Run sCmdLine & Str, 1, False
Example: add "-udf on":

Code: Select all

TextStream.Close

Str = Str & "-udf on"
WshShell.Run sCmdLine & Str, 1, False
Works perfectly !!!
Thank you very much for your help.
:D
#226365 User License
Post Reply