DOS command in XP

S

Svend Cr

I am a bit of a DOS newbie. I want to execute the following DOS
command in XP by clicking on a BAT file with this command in it:

attrib +h .\descript.ion /s

It is to change the attribute byte of any file called
"descript.ion" to be hidden.

I guess need to precede that command with something to make it
start executing in the root folder:

cd \

What else do I need to put into the BAT file so that the commands
execute and I can see the DOS window to know when it is over?

Do I need to use "CMD" at the beginning? What about "CMD /K"?

I have tried the following but it seems to get stuck on the first
line and not go any further:

cmd /k
attrib +h .\descript.ion /s
echo Finished processing DESCRIPT.ION files
 
K

Kenneth Brody

Svend said:
I am a bit of a DOS newbie. I want to execute the following DOS
command in XP by clicking on a BAT file with this command in it:

attrib +h .\descript.ion /s

It is to change the attribute byte of any file called
"descript.ion" to be hidden.

I guess need to precede that command with something to make it
start executing in the root folder:

cd \

Or give an absolute path to the "attrib" command:

attrib +h \descript.ion /s
What else do I need to put into the BAT file so that the commands
execute and I can see the DOS window to know when it is over?

Do I need to use "CMD" at the beginning? What about "CMD /K"?

No. The BAT file is already being run by cmd.
I have tried the following but it seems to get stuck on the first
line and not go any further:

cmd /k
attrib +h .\descript.ion /s
echo Finished processing DESCRIPT.ION files

Your first line says "run another command shell and stay in that shell
until I execute 'exit'". Remove it.

To wait when done, you can add "pause":

@echo off
attrib +h \descript.ion /s
echo Finished processing DESCRIPT.ION files
pause
 
M

Matthias Tacke

Svend said:
I am a bit of a DOS newbie. I want to execute the following DOS
command in XP by clicking on a BAT file with this command in it:

attrib +h .\descript.ion /s

It is to change the attribute byte of any file called
"descript.ion" to be hidden.

I guess need to precede that command with something to make it
start executing in the root folder:

cd \

What else do I need to put into the BAT file so that the commands
execute and I can see the DOS window to know when it is over?

Do I need to use "CMD" at the beginning? What about "CMD /K"?

I have tried the following but it seems to get stuck on the first
line and not go any further:

The dot in front of the backslash made your command relative to the
current folder.

@echo off
attrib +h \descript.ion /s
echo Finished processing DESCRIPT.ION files
pause

IMO your question should have been posted in
X'Post mpwg, comm, comp
 
P

Paul O. BARTLETT

I am a bit of a DOS newbie. I want to execute the following DOS
command in XP by clicking on a BAT file with this command in it:

attrib +h .\descript.ion /s
[trim]

Just for the record, your question is not about DOS. It is about
the quasi-emulation of some DOS functions under Windows XP, which is
not the same thing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top