Link to home
Start Free TrialLog in
Avatar of Nirmal Sharma
Nirmal SharmaFlag for United States of America

asked on

PSEXEC

Can anyone tell me how can I list Directories and files on a remote computer using PSEXEC?

I issue the following commands :

PSEXEC \\remote_computer\ dir c:\

It returns with an error : "The system can not find the file specified"

Dir is a DOS Shell command and built into command.com or OS Shell.

Does PSEXEC retreives/interprets with DOS/Windows Internal commands?

Thanks!
SOLUTION
Avatar of NacMacFeegle
NacMacFeegle
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nirmal Sharma

ASKER

I know I can use above commands...I just have an query regarding how PSEXEC interacts with DOS internal commands since they are not created physically but exists logically.
SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, I'm not sure if that command works or not but it looks like it should work.

BTW: when I run the above command I get the following error:

login failure or bad password.

I have tried using -u user_name and -p password but to no avail.
Ok the above command runs without any exit code 0 but doesn't list anything...

It should list Directories of remote computer....I have also tried using > file_name.txt
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not command.com but CMD.exe.

Thanks for putting me on right track.
BTW: I don't have authentication problem. I'm specifying NetBIOS name of computer name. I should put FQDN so that authentication can be handled by Kerberos.

NetBIOS leads to broadcast - sometimes it is able to authenticate and sometimes not.