Solved

Batch file addressing help

Posted on 2007-04-09
6
176 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 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

19 Experts available now in Live!

Get 1:1 Help Now