AS400 Win7 on Win10/win11 using execute-process on .cmd file not working as expected

Hi Experts,

I had follow suggested command from others post to run the .cmd file as below:

Execute-Process -Path “C:\Windows\System32\cmd.exe” -Parameters “$dirfiles\Install.cmd” seems not working.

This is whats inside the .cmd file.

Setup.exe /s /v"ADDLOCAL=ALL CWBINSTALLTYPE=Complete CWBPRIMARYLANG=MRI2924 REBOOT=ReallSuppress /qn"
Del “C:\Users\Public\Desktop\IBM i Access for Windows.lnk”
Del “C:\Users\Public\Desktop\System i Navigator.lnk”

Anyone could give me suggestion is very much appreciated. :slight_smile:

You could try with these commands instead of using a .cmd file.

Execute-Process -Path "$dirFiles\Setup.exe" -Parameters "/s /v`"ADDLOCAL=ALL CWBINSTALLTYPE=Complete CWBPRIMARYLANG=MRI2924 REBOOT=ReallySuppress /qn`""
Remove-File -Path "C:\Users\Public\Desktop\IBM i Access for Windows.lnk"
Remove-File -Path "C:\Users\Public\Desktop\System i Navigator.lnk"
1 Like

You need to add /c after cmd.exe to execute a cmd file.

But yes, using native PSADT commands is much better, you’ll get logging and it’ll skip the later actions if the installer fails.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.