Need help: Setting a unknown path as a variable
Posted: 31 Oct 2009 08:06
Hey, guys!
(First of all, please excuse my bad English-skilled - I still try to learn English)
I've got a problem with setting an unknown path as a variable. I want to search the file javakarasettings (it's a settings-file of the little program Javakara) and set its path as a variable.
I tried it for a couple of hours and got no ideas left. My Script looks like that:
Javakara-x-JSDK.bat
But this does not work at all. I used Google to search a good solution for my problem but this script is the best (but useless) solution for me...
Well, I am a newbie to coding and Batch-Scripts but this one is really tricky.
I hope that anyone in here can help me!
Bye, X-Zat
EDIT: Well, this line works great but is useless because I want to get the variable without reading a file created by my script . And I do not know any way to use to get a variable without writing this info into a file...
(First of all, please excuse my bad English-skilled - I still try to learn English)
I've got a problem with setting an unknown path as a variable. I want to search the file javakarasettings (it's a settings-file of the little program Javakara) and set its path as a variable.
I tried it for a couple of hours and got no ideas left. My Script looks like that:
Javakara-x-JSDK.bat
Code: Select all
@echo off
title Java-SDK- Compiler-Pfad!
dir /S /B *.javakarasettings>"Wo ist Javakara.txt"
for %%i in ('dir /S /B C:\*.javakarasettings;D:\*.javakarasettings | findstr "javakarasettings") do set path=%%j
echo %path%>"Pfad von Javakarasettings.txt"
pause
But this does not work at all. I used Google to search a good solution for my problem but this script is the best (but useless) solution for me...
Well, I am a newbie to coding and Batch-Scripts but this one is really tricky.
I hope that anyone in here can help me!
Bye, X-Zat
EDIT: Well, this line
Code: Select all
dir /S /B *.javakarasettings>"Wo ist Javakara?.txt"
Code: Select all
dir /S /B *.* | findstr "*.javakarasettings"