Solved

Insert credentials into a simple script

Posted on 2014-09-23
2
186 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
2 Comments
 
LVL 24

Accepted Solution

by:
Mohammed Khawaja earned 500 total points
Comment Utility
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
Comment Utility
Mohammed - Worked perfect. Thanks for putting that together for us.

Doug
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WPF - External data binding to controls inside a UserControl 2 42
for loop with Set 4 45
countX 22 68
mapAB Challlenge 35 84
This article will show, step by step, how to integrate R code into a R Sweave document
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now