VMware Communities
Stubaan
Contributor
Contributor
Jump to solution

Calling a .bat script in Windows from Mac Terminal

I am trying to call a batch script I have in my Windows VM from Terminal on the Mac side. Using the vmrun command I am able to access the VM and execute the .bat file but for some reason it cannot find any of the file locations specified in the script (the script works just fine when executed directly within the VM). This implies that the location from where the .bat is being executed when called from Terminal is not the actual location of the .bat file on the Windows machine, as it would be when executed manually from within the Windows VM. Can anyone please help me to resolve this?

0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

The batch script will be executed in the guest by a program whose working directory will not necessarily be the directory that contains the script. So, you should use absolute paths in the script, or else pass in the path to the script as an argument to the script, and use that in the script to find other files.

View solution in original post

0 Kudos
1 Reply
admin
Immortal
Immortal
Jump to solution

The batch script will be executed in the guest by a program whose working directory will not necessarily be the directory that contains the script. So, you should use absolute paths in the script, or else pass in the path to the script as an argument to the script, and use that in the script to find other files.

0 Kudos