Hello,
We recently installed Alteryx Server v2023.1 and are working on new projects that require us to always have the latest files from SharePoint / OneDrive synced to our server computer (these are often .xlsm, so neither the SharePoint nor OneDrive Alteryx tools / connectors will help us). The attached workflow shows some Run Command prompts that have been helpful to "shutdown" OneDrive.exe and "restart" it in the background of our Server computer.
We have this workflow running every morning on our Server machine at 5 a.m. to re-sync the newest files, but we've noticed like the screenshot below shows - the RunCommand tool always gets to 100% after about 5 seconds of running, but never quits. For this reason, we had to force it to stop running use the "Wait A Second" crew macro and a "Test" tool, combined with the "Cancel Workflow on Error" workflow option. This does seem to work, but we'd rather not schedule this workflow to run every 5 minutes throughout the day on the Server - but would rather put this grouping of tools at the very beginning of our "important" workflows that require the latest and greatest files to be synced, before reading them in via Dynamic Inputs / Directories.
Does anyone has any suggestions on how to tweak the RunCommand tool to stop running the "/background" feature of the OneDrive.exe after a given interval of time? I'm used the timeout option being written after the /background line, but the Command Prompt never actually gets to that timeout line to stop execution. This particular tool and /background option seems to be destined to run infinitely unless some other syntax can be found to stop the tool programatically.
Any suggestions would be much appreciated!
Solved! Go to Solution.
@taxguy33 , I believe you can accomplish this thru the "Events" workflow configuration settings. see screenshot below.
My script was as follows.
taskkill /im onedrive.exe /F
cd "C:\Users\[username]\AppData\Local\Microsoft\OneDrive"
start onedrive.exe
If this helps resolve your issue, please mark this reply as the solution so that others in the Community can benefit from our collaboration!
Thanks.
@AndrewSu Thank you for the idea, I was able to tweak your example as explained below to make it work for our situation. Our working directory on Alteryx Server is the E drive and our OneDrive application is in a slightly different folder than your example above, so our "OneDrive Restart.bat" file has the syntax as below:
taskkill /im onedrive.exe /F
timeout -t 15
cd C:
cd "C:\Program Files\Microsoft OneDrive"
start OneDrive.exe /background
timeout -t 35
We've been able to add this to the "Events" screen on a "Before Run" option for our mission critical workflows that require the most up to date files be referenced. We tested it extensively and found the "sync" feature is happening this method and capturing the new files that were added while the OneDrive connection was temporarily suspended.