I have a complex python based model that is executable only in linux environment. But it needs to be scheduled daily from windows operating system. So, I have installed ubuntu app in windows by activating the Windows subsystem for linux (WSL), and that is working fine when executed manually. But the real problem starts when I need to schedule the execution by using batch file. I am able to open the ubuntu app by using:
echo off
start ubuntu.exe
however, when entering any other command in the batch file (eg. changing the drive, start ubuntu.exe cd /mnt/d/), then the whole ubuntu terminal disappears. I guess the problem could be solved when it could be figured out that how to type commands into a ubuntu terminal by using cmd. Any help to give sort of lead is appreciated.
Thanks in advance
Type commands in ubuntu app (WSL) from batch file in windows
Moderator: DosItHelp
-
- Posts: 1
- Joined: 06 Jul 2021 13:56
Re: Type commands in ubuntu app (WSL) from batch file in windows
You're heading in the wrong direction. Batch doesn't interact with any other window. And remote controlling of another application is the very last thing you should ever consider.
Directly use wsl.exe to execute your Linux command. E.g.
No cmd.exe or Batch script necessary, not even in a scheduled task.
Steffen
Directly use wsl.exe to execute your Linux command. E.g.
Code: Select all
wsl.exe "sleep 5s"
Steffen