I have a PowerShell script to executes a DMT in command line mode. It’s been working for years, and now I’m getting the error (in Windows event viewer):
PS C:\EpicorData\PowerShellScripts> C:\EpicorData\PowerShellScripts\ShipmentNoticeTrigger.ps1
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At C:\EpicorData\PowerShellScripts\ShipmentNoticeTrigger.ps1:18 char:1
+ Start-Process -Wait -FilePath $DMTPath -ArgumentList "-NoUI -ConfigValue MATCOR ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
The PS Script hasn’t changed (the PS1 file has a date of 8/15/2017), so I’m wondering if a windows update may have changed how PS runs.
Here’s my PS Script:
# This Script runs the Epicor DMT utility to update table UD05
# The change of UD05.Checkbox20 from 0 -> 1 initiates a Data Directive
# that generates the code to auto email shipping notices.
# This should be run at 4:00 PM EST every day
$DMTPath = "C:\Epicor\ERP10\LocalClients\MATCOR\DMT.exe"
$User = "_glbl_epicor"
$Pass = "redacted"
$Source = "C:\Temp\trigger.csv"
echo "Company,Key1,Key2,Key3,Key4,Key5,CheckBox20" > $Source
echo "MC,CKRU,,,,,1" >> $Source
echo "MC,CKRU,,,,,0" >> $Source
#Load Data
Start-Process -Wait -FilePath $DMTPath -ArgumentList "-NoUI -ConfigValue MATCOR -User $User -Pass $Pass -Update -Import UD05 -Source $Source "
The error mentions ...ShipmentNoticeTrigger.ps1:18 char:1
and line 18 is the one that starts with Start-Process...
Asking a stupid question but…it says it cannot find the file specified… I assume you checked that the file hasn’t moved? or that permissions havent’ changed in that folder?
Hmm looks like a corrupted DMT… Try downloading a new version?
Any other similar issues can you open other files in the same folder fine? I don’t want to scare you but I’ve seen similar behavior before when there’s Cryptomalware going to town on your files… (hopefully not but I had to throw it out there)
Alternatively and hopefully less scary (depending on perspective) this looks like maybe Windows Smart screen is blocking DMT. I would check with your admin (assuming thats not you) to see if any new policies or patches / feature updates have been applied to the client. you can configure Windows to allow running the app but check with IT first.
I tested downloading the update from DMT with no issues. It could be something on your workstation. to prevent this error please install manually. DMT 4.0.41.2 attached.
It’s weird that downloading DMT does not have or use any installation program. Just copy the two files (the EXE and the DLL) to a folder and launch the EXE file.
BUt when you do an update from withing DMT, it uses some sort of installer. And I guess that is what requires the .NET 3.5
Installers will also make sure those files are placed in specific locations, AND “register” them (create registry keys, update other program files of their existence, etc …) AND check for requirements to run the program…
@ckrusen I had some issues that were unable to install the .NET framework because of some WSUS issues, not sure about your environment, but I ended up going into the registry and disabling the UseWsus registry, so that the machine would go to Windows for updates instead of a WSUS server and was able to install the correct framework. Also may be worth checking / stopping any type of firewall that may not be allowing it to get out and install the framework.