Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed - psexec with Text File - Access Denied Error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

psexec with Text File - Access Denied Error

 Post Reply Post Reply
Author
Message
tbalci View Drop Down
Newbie
Newbie


Joined: 19 September 2012
Location: Istanbul
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote tbalci Quote  Post ReplyReply Direct Link To This Post Topic: psexec with Text File - Access Denied Error
    Posted: 19 September 2012 at 9:54am
Hello,

I have a file servers.txt under C:\Users\user_name\servers.txt. I want to execute "winrm quickconfig -q" command as follows:

psexec -h \\@"C:\users\user_name\Desktop\servers.txt" -u domain\domainadmin_user_name -p Pa$$w0rd cmd "winrm quickconfig -q"

However, it fails with error:

Error opening C:\users\user_name\Desktop\servers.txt:
Access is denied.

There are no problems in accessing the txt file nor the credentials. It seems that the problem is elsewhere, but could not figure out.

Any ideas?

Thank you in advance.


Edited by tbalci - 19 September 2012 at 11:52am
Back to Top
spatters View Drop Down
Newbie
Newbie
Avatar

Joined: 27 September 2012
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote spatters Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2012 at 3:50pm
Are you running as the user whose desktop you're trying to access?
 
Maybe you're not running with elevated credentials ("as administrator")?
Back to Top
WindowsStar View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 June 2010
Status: Offline
Points: 622
Post Options Post Options   Thanks (0) Thanks(0)   Quote WindowsStar Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2012 at 8:03pm
Originally posted by AlisaBin AlisaBin wrote:

Hello friends, Long Path Tool helped me in this situation. http://PathTooDeep.com. Visit this site for collect more information.
 
Please no SPAM, how does this tool help with the problem. Plus this tool is useless, why pay for something that you can do for free. Windows Command Prompt, VBScript, CMD Script, and PowerShell all can do this for free. Please don't post something that is not helpful. Thanks -WS 
Back to Top
aaronmar View Drop Down
Moderator Group
Moderator Group


Joined: 13 July 2010
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote aaronmar Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2012 at 2:45am
I assume "servers.txt" contains the list of servers on which you want to run the command?  In that case, you shouldn't have the leading backslashes before the @ sign.  Also, if you are running PsExec.exe without admin rights (e.g., from an admin/elevated Command Prompt) and under a different user account, PsExec probably won't be able to read servers.txt from another user's desktop.  Try putting servers.txt into a common location (e.g., \users\public\documents).  Finally, I would put the -h option after the computer, user and password options and before the command you want to run.  (I can't remember whether that matters, but I've always put the computer specifier first...)
 
Hope this helps.
-- Aaron Margosis (Microsoft)
co-author of The Windows Sysinternals Administrator's Reference.
http://www.amazon.com/Windows-Sysinternals-Administrators-Reference-Russinovich/dp/073565672X
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down