0

In Perl, I want to get the current working directory of any process.

e.g. We have command "pwdx" in unix which gives current working directory of a process.

I want similar "pwdx " in perl.

Please let me know any Perl command which gives me current working directory of a process.

Note: I am on Windows platform and not in Unix platform.

Regards,

Amol

mpapec
  • 49,466
  • 8
  • 63
  • 119
user3253461
  • 61
  • 1
  • 1
  • 7

2 Answers2

0

You could get the details about a process (along with current working directory) with wmic or handle shell commands, as described in this question: windows batch command to determine working directory of a process

Then you could use that command with backticks (``) to get the output and use a regex to get the current working directory.

Note: I'm not on windows so I can't test the commands.

Community
  • 1
  • 1
T3MP
  • 36
  • 3
0

You might look at Win32::Process modules.

brian d foy
  • 124,803
  • 31
  • 200
  • 568
Neil H Watson
  • 922
  • 1
  • 12
  • 29