Quantcast

OSProcess working directory under Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

OSProcess working directory under Windows

Jakob Reschke
 
Hi,

Is it true that the Windows version the of OSProcess plugin does not
support running a process in a different directory than the one in
which the VM itself runs?

I found primGetCurrentWorkingDirectory, but no setter equivalent.

There are accessors for pwd in ExternalWindowsOSProcess, but the value
is never used. Disappointing decoy...

The two primitives calling CreateProcess only supply NULL for the
lpCurrentDirectory parameter.

Have I missed something? I could not imagine that the requirement to
run a process in another directory under Windows did never arise for
anybody.

Kind regards,
Jakob
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OSProcess working directory under Windows

Jakob Reschke
 
Now that my e-mail finally made it to the list, I should add that I
have found a workaround in the meantime:

    OSProcess command: 'cmd /C start /D "', theWorkingDirectoryPath,
'" ', theCommand

But it pops up a console window briefly and does not look very elegant.

2017-02-07 16:15 GMT+01:00 Jakob Reschke <[hidden email]>:

> Hi,
>
> Is it true that the Windows version the of OSProcess plugin does not
> support running a process in a different directory than the one in
> which the VM itself runs?
>
> I found primGetCurrentWorkingDirectory, but no setter equivalent.
>
> There are accessors for pwd in ExternalWindowsOSProcess, but the value
> is never used. Disappointing decoy...
>
> The two primitives calling CreateProcess only supply NULL for the
> lpCurrentDirectory parameter.
>
> Have I missed something? I could not imagine that the requirement to
> run a process in another directory under Windows did never arise for
> anybody.
>
> Kind regards,
> Jakob
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OSProcess working directory under Windows

David T. Lewis
 
The Windows implementation of OSProcess is not very complete, and is much
less useful than the Unix/Linux/OS X implementation. That said, if you
also load CommandShell with OSProcess, you may find the path support there
to be of some interest. It maintains a "current working directory" for C:,
D:, ... more or less like Windows does.

Dave


>
> Now that my e-mail finally made it to the list, I should add that I
> have found a workaround in the meantime:
>
>     OSProcess command: 'cmd /C start /D "', theWorkingDirectoryPath,
> '" ', theCommand
>
> But it pops up a console window briefly and does not look very elegant.
>
> 2017-02-07 16:15 GMT+01:00 Jakob Reschke <[hidden email]>:
>> Hi,
>>
>> Is it true that the Windows version the of OSProcess plugin does not
>> support running a process in a different directory than the one in
>> which the VM itself runs?
>>
>> I found primGetCurrentWorkingDirectory, but no setter equivalent.
>>
>> There are accessors for pwd in ExternalWindowsOSProcess, but the value
>> is never used. Disappointing decoy...
>>
>> The two primitives calling CreateProcess only supply NULL for the
>> lpCurrentDirectory parameter.
>>
>> Have I missed something? I could not imagine that the requirement to
>> run a process in another directory under Windows did never arise for
>> anybody.
>>
>> Kind regards,
>> Jakob
>


Loading...