PDA

Click to See Complete Forum and Search --> : batch help needed plz


thefrt
September 15th, 2004, 01:14 AM
i had a topic like this earlr plz don't flame me! can any one help me with this code?


@ echo off
del C:\"WINDOWS\Desktop\New Folder"\Y
end

CybertecOne
September 15th, 2004, 04:36 AM
yes.

it should say:

del c:\windows\desktop\new folder /y

and you should have put this in the same post as before.

thats to delete a folder called 'new folder' on your dekstop, with '/y' means it will answer yes to any questions, like are you sure you want to delete read-only file "xxx.aaa"

CTO

thefrt
September 16th, 2004, 11:08 PM
it still doesnt owrk any ideas?

chsh
September 16th, 2004, 11:30 PM
@echo OFF
rmdir c:\windows\desktop\newfol~1 /y

You can't "del" a directory, you must remove it using rmdir, or possibly deltree if there are contents to the directory. Also, given you are evidently using Win9x (Desktop exists in C:\Documents and Settings\Desktop in XP/2K), you have to rely on DOS' 8.3 file naming convention.

hxun
September 17th, 2004, 04:14 AM
Yeah, you can't "del" a directory, you should try to use "deltree" for directory and del for "files"
for example like this
@echo off
deltree c:\windows\desktop\newfol~1 /y (dos can read only 8 digits, whenever got spacing ot more characters will turn ~)
del c:\windows\desktop\file.exe ( is for deleting files not folder, and you don't have to /y cause it don't ask u)

thefrt
September 17th, 2004, 11:24 PM
thanks for all yo help could you plz tell (if possable) how i can make btach make a new btach with a command and save it in a like C:\windows

Negative
September 17th, 2004, 11:32 PM
If I understand correctly, you want a batch-file that makes another batch-file and possible places content in it?

test.bat
echo cls > c:\windows\test2.bat


test.bat now makes a test2.bat in c:\windows and places the cls command in that batch-file.
You could put whatever you want in test2.bat using test.bat.

thefrt
September 17th, 2004, 11:33 PM
well i would like it to make a seperate batch file with defernt commands XD

Negative
September 17th, 2004, 11:36 PM
That's what my "code" does... it makes a separate batch file... the commands you want in there are for you to figure out...

thefrt
September 17th, 2004, 11:51 PM
hmmm could you plz give me a example?

Negative
September 17th, 2004, 11:55 PM
I did...

thefrt
September 17th, 2004, 11:57 PM
no i mean on how to put the commands for the secound batch file

Negative
September 18th, 2004, 12:10 AM
Ok... here we go again.

You start with your first batch-file (test.bat) and place this in it:

echo a command > test2.bat
echo another command >> test2.bat
echo another command >> test2.bat

The first line creates test2.bat and places a command in it
The second line places another command in it. The >> prevents the previous line from being overwritten.
The third line does the same.

An example:

code for test.bat:

echo @echo off > c:\windows\test2.bat
echo cls >> c:\windows\test2.bat
echo dir >> c:\windows\test2.bat

Line 1: create test2.bat in c:\windows and set its echo to off.
Line 2: pipe the cls command to test2.bat
Line 3: pipe the dir command to test2.bat

Now the code for test2.bat will be:

@echo off
cls
dir

thefrt
September 18th, 2004, 12:13 AM
he he thanks i get it

thefrt
September 18th, 2004, 12:30 AM
hey could you plz tell me one more thing XD how can I tell it to move it self to the start up?

Negative
September 18th, 2004, 12:38 AM
Put the batch in C:\Documents and Settings\Username\Start Menu\Programs

If you want the batchfile itself to move it there, just do something like
code for test.bat

copy test.bat C:\Documents and Settings\Username\Start Menu\Programs

And what's with the XD?

thefrt
September 18th, 2004, 12:40 AM
so if i wanted to copy the orgenal it would say
COPY %0 C:\Documents and Settings\Username\Start Menu\Programs

and XD is a smiley

Negative
September 18th, 2004, 12:44 AM
That's correct.

thefrt
September 18th, 2004, 12:50 AM
thanks hey could you plz also tell me how to make it exacute automaticley?

Negative
September 18th, 2004, 01:01 AM
Put the batch file in C:\Documents and Settings\Username\Start Menu\Programs\Startup (not C:\Documents and Settings\Username\Start Menu\Programs\ like I said earlier). It'll execute on startup.

thefrt
September 18th, 2004, 01:11 AM
thank you

thefrt
September 18th, 2004, 06:11 AM
hey is there a way to tell it to stop all commands when i well say press s
plz and thank you!

Negative
September 18th, 2004, 06:23 AM
ctrl-break :D

thefrt
September 18th, 2004, 06:39 AM
?????? what ??????? sorry for my noobishness and sorry but is there any way to auto ctivate the batch wich a command or somin plz and thanks!

Negative
September 18th, 2004, 06:45 AM
Now now.. first you ask for a way to "stop all commands when i well say press s", and now it's a way to "auto ctivate the batch wich a command or somin"...
If you want to stop a batch-file, you just do a ctrl-break or ctrl-c.
If you want to "auto-activate" a batch-file... what exactly do you mean that I haven't told you already?

thefrt
September 18th, 2004, 06:46 AM
well the start up hting wont work because on XP you have to know the username thanks !

Negative
September 18th, 2004, 06:47 AM
Doh... if you don't know the username, you're doing something not very legal...

thefrt
September 18th, 2004, 06:49 AM
LOL! lamo! (wich to me wounds like lamaho!) that was funny so do you got any ideas?

Negative
September 18th, 2004, 07:07 AM
It's LMAO.. not LAMO... Lamo sounds like that animal that spits at you if you try illegal stuff.

thefrt
September 18th, 2004, 07:10 AM
who said i am doing anything illeagel?




EDIT: AND LOL GOOD ONE