Script to run a .bat file

I have an opensource Powershell script, called OneDriveMapper.PS1, which literally maps a drive letter in Explorer to a OneDrive cloud storage. The easiest way to get end users to run the PS1 was to run it via a .bat file.

This is the content of that .bat file:
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& ‘S\path-to-script\OneDriveMapper_v1.ps1’”

Doing it this way means end users don’t have to deal with Powershell execution policies, etc.

I tried creating a procedure, to run this remotely hosted (on a mapped drive letter that points to a file server location) and while the procedure shows as having finished running on the endpoint, nothing happens.

This is what is in the procedure:

import os
os.system( ‘P:\Path-to-folder\ODriveMapper.bat’ )

Please can you help me with this?
Many thanks!

Hi @PCFixed

We will provide you Script on Monday.
Thank you.

Hello @PCFixed
While waiting for the custom script, you may want to check C1’s Library of Automation Procedures. There are many scripts there that can possibly help you with your MSP tasks. You can start with a powershell keyword search.

Hi @PCFixed
Please refer the script to run powershell command file with specified path.