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
  • 50,217
  • 8
  • 67
  • 127
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
  • 129,424
  • 31
  • 207
  • 592
Neil H Watson
  • 1,002
  • 1
  • 14
  • 31