Answered Question
How can I make a batch file that copies text from a .txt file on one domain to a text file on another domain?
This is a bit difficult to explain but here are the basics of what I am trying to do. This would be a fun little thought experiment for a computer person.
MachineA is in DomainA.
MachineB is in DomainB.
MachineA is the only machine that can access MachineB on DomainB.
MachineB CANNOT access MachineA on DomainA.
So say I am on a random server. I want to click a batch file and have it connect to DomainA\MachineA and then copy text from a file on DomainB\Machine B down to a file on DomainA\MachineA.
I think I am on the right track, I just don't know the syntax for this...
psexec \\MachineA TYPE -u domain\user -p password \\MachineB\X\B.TXT>>\\MachineA\X\A.TXT
The above command is just random and may not make sense, it is just a linear idea of what I am trying to do. I connect to \\MachineA with my own credentials, and then from there run a command (TYPE) to pull back data from MachineB and then >> addend a file on MachineA.
I just don't know how to pass credentials to the server on a different domain without using psexec, and I can't use psexec because MachineB CANNOT see MachineA.
Confusing? =)
- In Windows Os |
- |
- Report |
-
Share
RSS
Best Answer Chosen by Asker
| January 27, 2009 08:54 PM |
For example:
NET USE X: \\MachineA\Folder /USER:YourDomain\Username password
NET USE Y: \\MachineB\Folder /USER:YourDomain\Username password
TYPE Y:\B.TXT >> X:\A.TXT
rem remove drive mappings
NET USE X: /D
NET USE Y: /D
If you go this route, make sure the user account is one that doesn't have access to anything vital on your domains, since the user's password in this case would be plainly visible from at least MachineA and from wherever the batch file is kept.
I wonder if you might be better off using Group Policy to make this happen; like maybe set up a folder which gets replicated (or even just uses a scheduled task periodically to scan the folder for changes and update the remote folder when necessary).
| Asker's Rating: |
For any interested parties, the correct syntax is:
NET USE X: \\MachineA\Folder password /USER:domain\username
Permalink | Report
Answer this Question
Related Questions
Ask a Question
Top Members
Most Popular Tags
Categories
- Anonymous
- Arts & Design
- Beauty & Style
- Books & Authors
- Business
- Cars & Transportation
- Consumer Electronics
- Coupons Deals
- Education
- Entertainment
- Environment
- Fitness
- Food & Drink
- From Email
- From Iphone
- From Twitter
- Health
- History
- Hobbies
- Home & Garden
- How Tos
- Humor
- Jobs
- Legal
- Local
- Love & Relationships
- Mahalo Answers Community
- Money
- Music
- News
- NSFW
- Parenting
- Pets
- Science & Mathematics
- Services
- Shopping
- Social Science
- Society & Culture
- Sports
- Technology & Internet
- Travel
- Video Games
Welcome New Members
- haro, November 27, 2009 11:48 PM
- melodyliggons, November 27, 2009 11:47 PM
- jackiedybowski, November 27, 2009 11:47 PM
- jenell, November 27, 2009 11:46 PM
- randfish, November 27, 2009 11:45 PM
Each Mahalo Dollar costs $1.
Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More