1. Check Windows Script Host Registry Settings
- Press
Win + R, type regedit, and press Enter
- Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings
- Look for a value named
Enabled
- If it exists and is set to
0, change it to 1
- If the key doesn't exist, create a new DWORD value named
Enabled and set it to 1
2. Verify Group Policy Settings
- Press
Win + R, type gpedit.msc, and press Enter
- Navigate to:
Computer Configuration > Administrative Templates > Windows Components > Windows Script Host
- Ensure "Turn off Windows Script Host" is set to "Not Configured" or "Disabled"
3. Run Command Prompt as Administrator
- Open Command Prompt as Administrator
- Run:
regsvr32 wshom.ocx
- Run:
regsvr32 scrrun.dll
- Run:
regsvr32 vbscript.dll
Power Automate Desktop Specific Solutions
4. Update Script Execution Method
In your Power Automate Desktop flow:
- Instead of using "Run VBScript" action, try using "Run DOS Command" action
- Use command:
cscript.exe "C:\path\to\your\script.vbs"
- Ensure the script path is accessible and permissions are correct
5. Alternative Script Execution
- Use "Run PowerShell Script" action instead
- Convert your VBScript logic to PowerShell, or
- Call your VBScript from PowerShell using:
cscript.exe "path\to\script.vbs"
6. Check Power Automate Desktop Service
- Open Services (services.msc)
- Find "Power Automate Desktop Service"
- Restart the service
- Ensure it's running under appropriate credentials
Security and Authentication Fixes
7. Run Power Automate Desktop as Administrator
- Right-click on Power Automate Desktop
- Select "Run as administrator"
- Test your flow again
8. Check Windows Defender/Antivirus
- Temporarily disable real-time protection
- Test if the script runs
- If it works, add Power Automate Desktop and your script location to antivirus exclusions
9. User Account Control (UAC)
- Temporarily lower UAC settings
- Test the flow
- If it works, you may need to modify your script or flow to handle UAC properly
Advanced Solutions
10. Recreate the Script Action
- Delete the existing VBScript action in your flow
- Add a new "Run VBScript" action
- Copy your script content again
- Test the flow
11. Check Script Content
- Ensure your VBScript doesn't contain any new authentication-related code
- Remove any references to network resources or external authentication
- Test with a simple script first:
MsgBox "Hello World"
12. Windows Updates
- Check if recent Windows updates caused this issue
- Consider rolling back recent security updates if they coincide with when the problem started
Testing Steps
- First, test if CScript works outside Power Automate:
- Open Command Prompt
- Run:
cscript.exe //NoLogo "C:\path\to\your\script.vbs"
- If CScript works manually but not in Power Automate, the issue is with Power Automate Desktop permissions or configuration.
If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
Regards,
Riyaz