Passing Log in Credentials with Pushd? other command

command line

My Scenario: I am running the pushd command to run searches on remote domain computers. However the search performs very slow/or not at all when a user is not logged on to the machine(machine is still powered on.)

I was wondering if it is possible to pass log in credentials with the pushd command. If not what are some alternate choices?

I cannot use other software or packages such as PsExec.

Best Answer

  • You can use:

    net use \\RemoteComputer\c$ password /user:MY_DOMAIN\remoteUsername
    "\\RemoteComputer\c$\Program Files\Java\jre6\bin\java" -version"
    net use \\RemoteComputer\c$ /d
    

    (Edited to add simplifications from grawity from comments. Learn something new every day!)