Solved

Insert credentials into a simple script

Posted on 2014-09-23
2
193 Views
Last Modified: 2014-09-24
How do i add credentials to the target folder portion of this script? Basically we are using it to temporarily copy files from one server to another but they are on separate domains. I want to stick with this script and format if possible for consistency.


set TargetFolder=G:\Share\*.pdf
set DestinationFolder=\\192.168.1.6\SHARE\SUBDIR

Move "%TargetFolder%" "%DestinationFolder%"
0
Comment
Question by:Solutionpartner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
Mohammed Khawaja earned 500 total points
ID: 40340640
this is what you could do:

set targetaccount=domainname\username
set targetpassword=password
set TargetFolder=G:\Share\*.pdf
set DestinationFolder=\\192.168.1.6\SHARE\SUBDIR

net use %DestinationFolder% /user:%targetaccount% %targetpassword%
Move "%TargetFolder%" "%DestinationFolder%"
net use %DestinationFolder% /delete
0
 

Author Closing Comment

by:Solutionpartner
ID: 40341879
Mohammed - Worked perfect. Thanks for putting that together for us.

Doug
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Auto-indent certain lines in Notepad++ 10 144
What are programming codes and how do they work? 7 112
ejb entity bean example 2 31
Java pass by reference 3 14
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question