Hello again dreeschkind
Your method does indeed work, there are no longer any problems with execution!
However, I have one last minor issue, purely aesthetic, but using this
method the process is launched in a new window (cmd.exe) and instantly closes
upon completion. I guess there are two possibilities here:
1. My first preference would be a method to simply run the process inside
the PowerShell window(process), or failing that, background the cdimage.exe
process but redirect all of it's output to the PowerShell process, which is
almost just as good. I took a look at the relevant references in the MSDN
library:
http://msdn2.microsoft.com/en-us/lib...roperties.aspx.
Would the Redirect* objects be of use here? Sorry, but I'm not a programmer
2. Failing that, I guess the next best option would be to simply have the
process window automatically close on the completion of the process, this
could be done through the "pause" command, but I'm not sure how or if that
could be parsed with the process execution to ensure it runs immediately
following the completion of the cdimage.exe process.
Thanks for your help dreeschkind, it is very much appreciated.
-SDL
"dreeschkind" wrote:
> I did not try this out, but may be this will work:
>
> ###############################################
> $StartInfo = new-object System.Diagnostics.ProcessStartInfo
> $StartInfo.FileName = '..\Tools\cdimage.exe'
> $StartInfo.Arguments = '-lWXP_PRO_JUN06 -t08/26/2006/20/41/15
> -b"..\src\bootsector.bin" -p0 -e -g -h -j1 -x -o -w1 -m "..\src" "C:\\Windows
> XP Pro - June 2006 Update.iso"'
> $StartInfo.WorkingDirectory = 'C:\' #fill in the correct directory here
> $StartInfo.LoadUserProfile = $true
> $StartInfo.UseShellExecute = $true
> [System.Diagnostics.Process]::Start($StartInfo)
> ###############################################
>
> Hope that helps.
>
> BTW: It might be easier to use only absolute path names and (if feasible)
> fewer arguments first, so that you can eliminate possible sources of error.
> This might help to localize the cause of failure.
>
> --
> greetings
> dreeschkind
>
> "SDL" wrote:
>
> > Greetings again,
> >
> > Thanks to both of you for the help, the 'invoke-expression' cmdlet is
> > exactly what I was looking for. However, I'm still having issues with the
> > command string being interpreted incorrectly. For example:
> >
> > '"..\Tools\cdimage.exe" -lWXP_PRO_JUN06 -t08/26/2006/20/41/15
> > -b"..\src\bootsector.bin" -p0 -e -g -h -j1 -x -o -w1 -m "..\src" "C:\\Windows
> > XP Pro - June 2006 Update.iso"'
> > Invoke-Expression : You must provide a value expression on the right-hand
> > side of the '-' operator. At X:\Scripts\Windows XP Image
> > Generation.ps1:
> > 44 char:18
> > + invoke-expression <<<< $IGS_CDImage_Execute
> >
> > This points to the '.' in the cdimage.exe part of the string. Simply put,
> > all I want is the "..\Tools\cdimage.exe" component to execute the cdimage
> > executable, and the rest of the string be passed "raw" and unmodified
> > directly to the cdimage executable for it to interpret itself. Thanks again
> > for the help provided.
> >
> > -SDL
> > "Jeffrey Snover [MSFT]" wrote:
> >
> > > Jouko has it right.
> > > & says "use the next token as the NAME of the thing to execute"
> > >
> > > --
> > > Jeffrey Snover [MSFT]
> > > Windows PowerShell/Aspen Architect
> > > Microsoft Corporation
> > > This posting is provided "AS IS" with no warranties, no confers rights.
> > > Visit the Windows PowerShell Team blog at:
> > > http://blogs.msdn.com/PowerShell
> > > Visit the Windows PowerShell ScriptCenter at:
> > > http://www.microsoft.com/technet/scr.../hubs/msh.mspx
> > >
> > >
> > >