Jason Paradis
asked on
Using PsExec with a batch file that asks for %USERPROFILE% or %USERNAME% in it's commands
When I use PsExec with a batch file residing on a remote computer that asks for the %USERPROFILE% or %USERNAME% of the remote session it always returns my username or user profile path.
How do I run this same command so that it returns the currently logged in user's %USERPROFILE% or %USERNAME% without modifying the commands in the bat file or having the user profile credentials from the currently logged in remote user.
These are on Windows 7 64-bit machines that reside within a domain.
How do I run this same command so that it returns the currently logged in user's %USERPROFILE% or %USERNAME% without modifying the commands in the bat file or having the user profile credentials from the currently logged in remote user.
These are on Windows 7 64-bit machines that reside within a domain.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So again, I guess I haven't explained correctly. I need to see the results of the batch file as soon as I run it. It's not a batch that does any configuration changes. It just reports on something and displays it in the command window.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don't need to find out which user is logged on. I need the script to run using the currently logged on user's userprofile and username when it calls for them. Currently, when it runs it uses my profile and name.