Hi
i'm beginner and i need help with reading previously created directory name, and open it.
Firstly i'll present you what i exactly want in steps.
1. Run test.exe
After running test.exe, some operations has been made and directory with random name has been created.
2. Open folder created in step1 and extract .cab file
Like i previously wrote i'm beginner and don't know how to open directory which was created few steps earlier.
someone will help me?
Reading folder name
Moderator: DosItHelp
Re: Reading folder name
The batch script language is more or less make for doing things like these.
To run a program, we simply do what's called 'call' it from the command line like this:
Assuming the batch file containing this code is in the same directory as 'test.exe' or 'test.exe' is in a directory specified in the %PATH% evironment variable.
To change the directory that the batch file is in ("Current Directory" or "Working Directory"), we use the CD command
where folder is the name to go into, or change to, for example, I could use:
to switch to the path C:\Program Files\Windows Media Player
[quote=pyniu]...directory with random name has been created.[/quote]
We can't change to a directory without knowing its name, unless the name always follows a pattern, like '123' followed by 4 letters, or some other pattern
Hope this helps
--Phillid
To run a program, we simply do what's called 'call' it from the command line like this:
Code: Select all
test.exe
Assuming the batch file containing this code is in the same directory as 'test.exe' or 'test.exe' is in a directory specified in the %PATH% evironment variable.
To change the directory that the batch file is in ("Current Directory" or "Working Directory"), we use the CD command
Code: Select all
cd [folder]
where folder is the name to go into, or change to, for example, I could use:
Code: Select all
cd "C:\Program Files\Windows Media Player"
to switch to the path C:\Program Files\Windows Media Player
[quote=pyniu]...directory with random name has been created.[/quote]
We can't change to a directory without knowing its name, unless the name always follows a pattern, like '123' followed by 4 letters, or some other pattern
Hope this helps

--Phillid