WinSCP Forum

This is a community forum and not official technical support. — If you need official support: Contact Us

The following comments are owned by whoever posted them. We are not responsible for them in any way.

Back to Threads Reply to Thread

Working nicely from command line & sh script

Thanks to a forum post I found somewhere in the general forum, I'm able to run winscp from the command line with the following script that I called "winscp.sh". Adjust exe_dir as needed to match where you put WinSCP.com in your bottle (see full_exe_path).


#!/bin/sh

# Where you keep CrossOver
crossover="/Applications/CrossOver.app"
bottle="WinSCP"
exe_dir="windows"
exe_name="WinSCP.com"

open "$crossover"

export DISPLAY=:`defaults read com.codeweavers.CrossOver Display`
export DYLD_FALLBACK_LIBRARY_PATH="$crossover/Contents/SharedSupport/X11/lib:$HOME/lib:/lib:/usr/lib:/usr/X11/lib"
export FONT_ENCODINGS_DIRECTORY="$crossover/Contents/SharedSupport/X11/lib/X11/fonts/encodings/encodings.dir"
export FONTCONFIG_PATH="$crossover/Contents/SharedSupport/X11/etc/fonts"
export FONTCONFIG_ROOT="$crossover/Contents/SharedSupport/X11"
export VERSIONER_PERL_PREFER_32_BIT=yes
export CX_BOTTLE="$bottle"
export PATH="$crossover/Contents/SharedSupport/CrossOver/bin:$PATH"

# Uncomment this if you need to be in the bottle's C: drive directory
#cd "$HOME/Library/Application Support/CrossOver/Bottles/$bottle/drive_c/Program Files/$exe_dir"
#full_exe_path="$HOME/Library/Application Support/CrossOver/Bottles/$bottle/drive_c/Program Files/${exe_dir}/${exe_name}"
full_exe_path="$HOME/Library/Application Support/CrossOver/Bottles/$bottle/drive_c/${exe_dir}/${exe_name}"

# This picks up the wine binary from newly modified PATH
wine ${full_exe_path} $@

CrossOver Forums: the place to discuss running Windows applications on Mac and Linux

CodeWeavers or its third-party tools process personal data (e.g. browsing data or IP addresses) and use cookies or other identifiers, which are necessary for its functioning and required to achieve the purposes illustrated in our Privacy Policy. You accept the use of cookies or other identifiers by clicking the Acknowledge button.
Please Wait...
eyJjb3VudHJ5IjoiVVMiLCJsYW5nIjoiZW4iLCJjYXJ0IjowLCJ0enMiOi02LCJjZG4iOiJodHRwczpcL1wvbWVkaWEuY29kZXdlYXZlcnMuY29tXC9wdWJcL2Nyb3Nzb3Zlclwvd2Vic2l0ZSIsImNkbnRzIjoxNzM2MzczNjgxLCJjc3JmX3Rva2VuIjoiTHRoYVFxWVpSZzRhbjdaaCIsImdkcHIiOjB9