PDA

View Full Version : DOs command


jjohn
08-10-04, 20:33
Hi guys- back again - good to see you all. Anubis and I have been a way for a while playing Doom3 - we're getting back into Lara games now tho. http://www.tombraiderforums.com/images/smilies/thumb.gif
I have a simple dos command problem - Sim or anyone else who knows please.:
I am tring to delete a directory and all it's sub -directories using a batch file without defining it's absolute path.
The folder resides in e:\program files\Trle
it is called x_music .
I can delete the contents no prob but to delete the directory itself i tried : DEL "%x_muisc%\*.*" /s /q
I would like to delete without defining the path so that it will work on someone else's computer no matter where it resides.
To my absoulte horror this command started very quickly deleting everything on the root of drive E and i lost about 300mb of data before i could stop it.
After that I am reticent to try anything without knowing that it works first.
Please could someone also point out what my command had been told to do and why it started deleting all those files. Thanks for any help.

Joseph
08-10-04, 21:07
Hi jjohn. I don't know. But i wanted to say welcome back. http://www.tombraiderforums.com/images/smilies/wave.gif
DEL "%x_muisc%\*.*" /s /q
music? Your command says muisc.

jjohn
08-10-04, 21:16
hi ya http://www.tombraiderforums.com/images/smilies/wave.gif Joseph - yep typo - actual command read x_music http://www.tombraiderforums.com/images/smilies/c-1.gif

Joseph
08-10-04, 21:19
Where did you get that command from, jjohn? http://www.tombraiderforums.com/images/smilies/smile.gif

jjohn
08-10-04, 21:28
I modified it from the Trle batch program that Sim helped make a few months ago. http://www.tombraiderforums.com/images/smilies/clown.gif

Joseph
08-10-04, 21:35
:D http://www.tombraiderforums.com/images/smilies/clown.gif reminds me of The Sourcerer's Apprentice... http://www.tombraiderforums.com/images/smilies/tongue.gif

Simulation
08-10-04, 21:47
Hi jjohn,

DEL "%x_music%\*.*" /s /q

My guess is that you didn't SET the variable %x_music%.

e.g.

SET x_music=c:\program files\trle

If you didn't set the value it has no value, so your command was....

DEL "\*.*" /s /q

which means delete everything from the root of the drive and all sub directories quietly..... AAAAAAHHHHHHH

Simulation
08-10-04, 21:49
Oh BTW I also bought DOOM3 a couple of weeks ago http://www.tombraiderforums.com/images/smilies/thumb.gif . Excellent graphics.

jjohn
08-10-04, 21:57
Originally posted by Simulation:
Hi jjohn,

DEL "%x_music%\*.*" /s /q

My guess is that you didn't SET the variable %x_music%.

e.g.

SET x_music=c:\program files\trle

If you didn't set the value it has no value, so your command was....

DEL "\*.*" /s /q

which means delete everything from the root of the drive and all sub directories quietly..... AAAAAAHHHHHHHThx for that sim - it was very quiet yes - but i wasn't when i saw it.
You're right i hadn't set a value to it - is there a way to delete then without settting or defining the absolute path?

Simulation
08-10-04, 22:06
Well, it has to be defined somewhere??

I must admit I can't really remember exactly what you were doing with the batch files? Was it about copying different users levels into the TRLE folders?

Does the batch file run in the TRLE folder?

jjohn
08-10-04, 22:16
Thanks Sim - yes and yes.
I didn't think there was a way to delete a directory without defining it's absolute path - i was just experimenting.

Simulation
08-10-04, 22:27
Ah.... but there is.....

Lets say you start the batch file in the folder c:\fred\play and there is a sub folder you wish to delete called jimbo.

You would normally say

DEL c:\fred\play\jimbo\*.* /s/q

as you are already in c:\fred\play you can type

DEL jimbo\*.* /s

I would also suggest it is best if the batch file checks first to see if it is in the correct folder before running a drastic command such as DEL *.*

Let us assume there is a known file in the play folder called mygame.exe. You can use the following test.

if not exist mygame.exe goto skipdel
del jimbo\*.* /s/q
...
... (rest of the batch file)
...

goto end

:skipdel
echo Error..... Batch file was not started in the folder play folder
:end

jjohn
08-10-04, 22:31
very comprehensive - http://www.tombraiderforums.com/images/smilies/thumb.gif thankyou

Simulation
08-10-04, 22:33
BTW

When testing batch files it is best to subsitute the DEL command to somethinf like DIR until you are satisfied that the batch file works as intended.

Bolted, Door, Horse, After Lock .... rearange words into a suitable phrase http://www.tombraiderforums.com/images/smilies/clown.gif

Simulation
08-10-04, 22:43
Whilst your here jjohn. Could you take a look at the new Tomb Raider 1 FAQ. I would appreciate any feedback. Ommisions and corrections greatfully received. http://www.tombraiderforums.com/images/smilies/tongue.gif

http://www.tombraiderforums.com/tr1walk/faq.html

[ 08. October 2004, 23:44: Message edited by: Simulation ]

jjohn
09-10-04, 01:14
I am honored that you seek my opinion.
Good job - In the common problems you could add:
In the cut- scene where Lara confronts Larsen for the first time the audio often stops short and the game may freeze.
Solution press esc or enter - persevere and then keep a saved game past this point.
This is a problem that i have read about several times and happens on my otherwise perfect install.
Everything else is pretty good and comprehensive - well done Sim http://www.tombraiderforums.com/images/smilies/thumb.gif

Neteru
09-10-04, 10:49
Hi jjohn, nice to see a friendly face back again. http://www.tombraiderforums.com/images/smilies/wave.gif

psst, Richard Lawther has a new level out - Ghost train at Caslte Orr. Check it out, it's great. ;)

jjohn
09-10-04, 11:17
Hi Neteru buddy http://www.tombraiderforums.com/images/smilies/wave.gif
Good to see ya
Anubis kept his new level very quiet from me
Is it as good as RDS?

Simulation
09-10-04, 12:27
Originally posted by jjohn:

In the cut- scene where Lara confronts Larsen for the first time the audio often stops short and the game may freeze.
Solution press esc or enter - persevere and then keep a saved game past this point.
Thanks jjohn http://www.tombraiderforums.com/images/smilies/thumb.gif

When you say "persevere" do you mean keep hitting the escape/return keys until it continues or just wait awhile?

Neteru
09-10-04, 12:33
Originally posted by jjohn:
Hi Neteru buddy http://www.tombraiderforums.com/images/smilies/wave.gif
Good to see ya
Anubis kept his new level very quiet from me
Is it as good as RDS?I found it much easier, but definitely as good I think. It's just nice to be back in one of his levels. Sadly, no Anubis in this level, just Demon Smalls. :(

jjohn
09-10-04, 20:53
Sim
By persevere i mean keep trying, because it doesn't work everytime. One of those partial fixes http://www.tombraiderforums.com/images/smilies/thumb.gif

Simulation
09-10-04, 22:57
Thanks for the clarification. http://www.tombraiderforums.com/images/smilies/smile.gif