Server Help

General Questions - Batch files

Cheese - Thu Jun 10, 2010 11:58 pm
Post subject: Batch files
so ive been working with batch files again, with large success, but theres one thing i havnt figured out yet:


i want to translate a path which could be
*/*/*/*/*/home/src/x/*/*/*.txt
i then want to move it to
*/*/*/*/*/home/bin/x/*/*/*.txt
in a batch file at
*/*/*/*/*/home
without doing chdir.
(where * = wildcard, obviously, and */*/ can be any number of dirs)

any ideas?



i also cant figure out how to tell which dir the batch file is running from, because chdir only does the working dir...
Samapico - Fri Jun 11, 2010 12:23 am
Post subject:
the batch file will run from its own directory. If you use a shortcut to run it, check target folder thing property of the shortcut, it sets the initial folder.
But you can easily set the starting folder in the batch file with a cd "..."

Why the */*/*/*/ if that's the directory of your batch file?

I have this that copied all the .so files from my src/... directory to the bin/... one, if that helps:
Code: Show/Hide

@echo off

for /D %%x in (*) do if exist "%%x\Release\%%x.so" copy "%%x\Release\%%x.so" "..\..\bin\Modules\%%x\%%x.so"

if exist "..\FrontEnd\cskinviewer\Release\Discretion.exe"  copy "..\FrontEnd\cskinviewer\Release\Discretion.exe" "..\..\bin\Discretion.exe"

Cheese - Fri Jun 11, 2010 12:43 am
Post subject:
wierd, the working dir is the batch files location, but not if you drop files on it for %1...
sirkillsalot - Fri Jun 11, 2010 9:53 pm
Post subject: try this
@echo off
cd path filename.txt move C:\path
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group