Windows XP Dir of remote machine - RunAs?

Joined
Jul 13, 2010
Messages
2
Reaction score
0
Hi everyone:

I am trying to pipe the contents a specific folder on a remote machine to a text file on my PC through a command line. My initial command looks like this:

dir \\10.11.222.33\c$\folder\subfolder\*.log >textfile.txt

As long as I have mapped a drive to the remote machine (thus already specifying the user name and password), this works great. As the above example goes, I would now have a text file on my PC called textfile.txt, which contains a DIR of *.log files from the remote folder.

However, if I haven't already mapped the remote drive, this command throws 'Access Denied' errors. I am trying to automate the command by running it through a batch file, so somehow I need to include the user name and password credentials in the actual command. I don't know much about RunAs, but what I've tried hasn't worked.

And though I appreciate the suggestion, mapping the drives in advance won't work for me because I don't have many available drive letters, and I have many remote machines I need to perform this command on (again, in batch). So I need a way to do this without mapping the remote drives.

And for various other network reasons, I can't use FTP or Telnet. Yeah. Fun.

I and the remote machines are running XP Pro.

If someone knows enough about RunAs to show me EXACTLY what I need to include in the command above, I would be extremely grateful. (Or, any other way to make this work given the limitations I've mentoned.)

Thanks loads,

PJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top