?
Solved

Batch file addressing help

Posted on 2007-04-09
6
Medium Priority
?
186 Views
Last Modified: 2010-04-16
Here is the scenario:

I have a batch file sitting in the folder 704011007-2695673140 . This is on a server being accessed through a mapped drive setup. So the drive on the server is E which is Z as the mapped drive on the computer I am using. I thought I would mention this in case this could cause problems.

The following is in the batch file...

md "\\e$\WorkQueue Inet\704011007-2695673140"
copy "e:\images\2. Pot O Gold Tournament\Kalamazoo Kings\14 YR\GAME 9\8353-DCM-200-2efv9919.jpg" "\\e$\WorkQueue Inet\704011007-2695673140\5x7 Print-8353-DCM-200-2efv9919.jpg"

Questions:
- does the md... cause issues when the folder already exists.
- if i need to clarify anything please ask

THANKS!

0
Comment
Question by:guy4graphics
[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
  • 3
  • 2
6 Comments
 
LVL 1

Author Comment

by:guy4graphics
ID: 18880227
Also, is are the paths addressed properly?
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18880229
"does the md... cause issues when the folder already exists." - no, but you can set it to only process if it doesn't using:

set folder="\\e$\WorkQueue Inet\704011007-2695673140"
if not exist %folder% then md %folder%
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18880232
e$ is the 'share' - you really need the full path of the server...
Something like

Set folder=\\servername\e$\WorkQueue Inet\704011007-2695673140
if not exist "%folder%" md "%folder%"
copy "e:\images\2. Pot O Gold Tournament\Kalamazoo Kings\14 YR\GAME 9\8353-DCM-200-2efv9919.jpg" "%folder%\5x7 Print-8353-DCM-200-2efv9919.jpg"

0
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 18880555
or...

as you are running it from Z: drive mapped to that folder already then you could use z:

"I have a batch file sitting in the folder 704011007-2695673140"
md "\\e$\WorkQueue Inet\704011007-2695673140"

So if the batch file is already in the dir. there is no point making the directory really, is there and also the current directory of the batch file should be that directory so just

copy "e:\images\2. Pot O Gold Tournament\Kalamazoo Kings\14 YR\GAME 9\8353-DCM-200-2efv9919.jpg" .

should copy it to the batch file directory

hth

Steve

0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18887041
well alright then...
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 18888473
Thanks for the answer/points... sorry sirbounty!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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