Solved

Batch file addressing help

Posted on 2007-04-09
6
175 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
Comment Utility
Also, is are the paths addressed properly?
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
"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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
Comment Utility
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
Comment Utility
well alright then...
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
Thanks for the answer/points... sorry sirbounty!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
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…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

17 Experts available now in Live!

Get 1:1 Help Now