Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The system cannot find the file specified #18

neoluu opened this issue Sep 29, 2019 · 2 comments · Fixed by #22


Copy link

@neoluu neoluu commented Sep 29, 2019


Im using python on linux and trying to execute an exe on a remote window 2008/2012/2016 server.
The windows domain account im using is part of an AD group that is a member of the server local Administrators group. Login on to the server with the account works and im able to do what i want.

But from my linux server via the python command, Im unable to use dfsutil.exe or dfscmd.exe to create DFS namespace links. I get error: Received exception from remote PAExec service: Failed to start "dfsutil.exe". The system cannot find the file specified. [Err=0x2, 2]

Those files are in C:\windows\system32, just like cmd.exe and cmd.exe works. Evironment variables are proper, I tried copying dfsutil.exe and dfscmd.exe to another directory and set the "working_dir" accordingly but it still does not work.

Permission on those two files are the same as cmd.exe. When I try "cmd.exe /c dir ., that returns file list excluding dfsutil.exe or dfscmd.exe, which is very strange? I also tried with full path to those exe, tried puttting command in a batch file and get the same result, Please advise?


This comment has been minimized.

Copy link

@jborean93 jborean93 commented Sep 29, 2019

There is an outstanding problem I need to fix where the psexec process is running as a 32-bit process on all systems. This means that C:\Windows\System32 is in fact C:\Windows\SysWOW64. This is why it can’t find the executable as it’s a different folder on a 32-bit process. You can either;

  • Make a copy of the executable in another folder that’s in the PATH env var
  • Use the redirected path to refer to the native System32 from a 32-bit process C:\Windows\sysnative\dfsutil.exe

I’m leaving this open to track the progress on. Changing the process architecture to match the host OS in a future release.


This comment has been minimized.

Copy link

@jborean93 jborean93 commented Nov 9, 2019

Just an FYI, here is the fix for this issue #22.

@jborean93 jborean93 closed this in #22 Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.