Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've successfully configured SSH under cygwin, so I can SSH into my windows user account and land at a bash shell in cygwin. This is great.

However, I have a python program that I'd like to run in this environment (I'll be running the Windows, not cygwin python) that expects many of the standard windows environment variables to be available. But if I start cmd.exe from within the cygwin bash shell I get a cmd.exe environment that is populated with a mix of cygwin-esque values (MANPATH, LOGNAME) and a subset of the windows-esque environment variables: It has ALLUSERSPROFILE and COMPUTERNAME, for instance, but many variables that I would typically see if I launched a command prompt window from the windows desktop are missing: PROCESSOR_ARCHITECTURE, NUMBER_OF_PROCESSORS, etc.

The program that I'd like to run from my SSH session (SCons) relies on these values, and several others. Is there any way to, within the SSH session, launch cmd.exe as subshell that will obtain a 'command prompt launched from the desktop' like environment?

I very much do not want to explicitly need to set all of the potentially necessary values myself as such a solution is quite fragile. I'm looking for an automatic mechanism.

Is there any mechanism by which I can obtain a 'desktop cmd.exe environment' from within a cygwin SSH session?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I take it the env vars you are missing are your user vars. By default, Cygwin only imports system vars when the shell is launched via SSH. You can try the solution linked to in this answer here to get Cygwin to import your user vars when launching via SSH.

share|improve this answer
    
Fantastic. That is exactly what I was looking for. Thanks! –  acm May 28 '13 at 23:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.