Froberg
OSNN Newbie
- Joined
- 5 Aug 2005
- Messages
- 6
Terribly sorry for bumping such and old thread, but I'm at my wits end here.
Fitz, you may be my saviour in this.
I need *almost* the exact same thing, except the files in the root must be intact.
I removed the cleanup feature to find out why this was not working, as well as the pause to actually see it.
Apparently, the files cannot be found. I'll try and translate it as best as I can;
The error message I get is: "The file cannot be found."
Is there any way you can see what I'm doing wrong, and help me fix it? I'd greatly appreciate it.
I am also trying to make a related script, and I won't bother everyone by making a separate thread for it - as it's related:
It's like this;
I've been scratching my head over this for some time now;
This is the code I've got so far, obviously the echo's are for debugging.
This is the aim of this script;
To create as many folders as required, in this case student names - e.g.: John, Jake, Peter etc.
I need it to create the folder, a .txt file within the newly created folder containing the number the folder was during creation - and the name of the folder.
As such: MAIN DIR\John\John.txt - containing string: <number>, <John>.
I hope this is clear enough.
I have yet to figure out the numbering issue, and it's a real head-scratcher. However, I have successfully managed to get it to create the .txt file with "John" in it.
However, when I try to make more than one folder - the script breaks only creating the folders, and no .txt files. This happens at the .txt file creation string.
That's basically where I'm stuck. I've worked on it for hours today, with no luck.
Please your wizard of command prompt! SAVE ME!
Fitz, you may be my saviour in this.
I need *almost* the exact same thing, except the files in the root must be intact.
Code:
So far I've adapted your code thusly;
@echo off
dir /b /ad %1 > dirlist.txt
for /f %%i in (dirlist.txt) do rd /s /q %1\%%i
pause
Apparently, the files cannot be found. I'll try and translate it as best as I can;
The error message I get is: "The file cannot be found."
Is there any way you can see what I'm doing wrong, and help me fix it? I'd greatly appreciate it.
I am also trying to make a related script, and I won't bother everyone by making a separate thread for it - as it's related:
It's like this;
I've been scratching my head over this for some time now;
Code:
@echo off
set /p name="Skriv elev navn(e): "
echo 1
md %name%
echo 2
echo %name%>>folderlog.txt
echo 3
echo %name%>%name%\%name%.txt
echo 4
pause
This is the aim of this script;
To create as many folders as required, in this case student names - e.g.: John, Jake, Peter etc.
I need it to create the folder, a .txt file within the newly created folder containing the number the folder was during creation - and the name of the folder.
As such: MAIN DIR\John\John.txt - containing string: <number>, <John>.
I hope this is clear enough.
I have yet to figure out the numbering issue, and it's a real head-scratcher. However, I have successfully managed to get it to create the .txt file with "John" in it.
However, when I try to make more than one folder - the script breaks only creating the folders, and no .txt files. This happens at the .txt file creation string.
That's basically where I'm stuck. I've worked on it for hours today, with no luck.
Please your wizard of command prompt! SAVE ME!