Skip to content

Windows command from different drive letter fails #16

Closed
@corsal

Description

@corsal

If my php file is being executed from my E:\ drive to a command running on my C:\ drive, it doesn't work since the cd is happening on the wrong drive.

I fixed it by doing the following:
$drive = substr($command, 0, 2);
$command = sprintf($drive . ' && cd %s && %s', escapeshellarg(dirname($command)), basename($command));

So $command becomes:
C: && cd "C:\Program Files\wkhtmltopdf\bin" && wkhtmltopdf.exe

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions