dual command

  • Thread starter Thread starter P. H. Allen
  • Start date Start date
P

P. H. Allen

Is there a way to execute an application under shortcuts, and then complete
a second process. An application I use always inserts a folder and
subfolders on my drive C: and I would like to execute the app and delete
the folders it installs. At this time, I have two shortcuts to accomplish
this, but would like having one to do the job. Thanks
 
Do it using the DOS emulator, a batch file, a shortcut to it and the rd
command. The /s switch causes the rd command to remove the folder,
subfolders and all files. The /q switch causes it to do it without asking
for permission first. These files/folders IIRC won't be stored in the
recycle bin.

Start notepad, type in the RD command above with the proper folder name and
save with a filename.bat extension to the System32 folder under Windows.

For the shortcut, right click on the .bat file created and create a
shortcut. Move the shortcut to where ever you want to start the shortcut
from. By double-clicking on the shortcut it will start the batch file and
run the remove directory command which will remove the folder and all its
subfolders.
 
As an addendum to my previous, you can start the program with your original
shortcut and put in the RD command as the next command. If it attempts to
run the RD command too soon, you can put in a Pause command between the two
to pause the batch file.
 
P. H. Allen said:
Is there a way to execute an application under shortcuts, and then complete
a second process. An application I use always inserts a folder and
subfolders on my drive C: and I would like to execute the app and delete
the folders it installs. At this time, I have two shortcuts to accomplish
this, but would like having one to do the job. Thanks

You could do it by embedding your commands in
a batch file, or you could join the commands with
an ampersand:

c:\install.exe & cmd /c rd /s /q "c:\Some Folder"
 
You could do it by embedding your commands in
a batch file, or you could join the commands with
an ampersand:

c:\install.exe & cmd /c rd /s /q "c:\Some Folder"

You know, I useta be real good at writing batch files. I guess "use it or
Lose it" is simply a fact. Thank you for pointing me to the correct path.
I work in 4NT and the code that did the trick was:

pushd C:\Program Files\Sierra\Hallmark Card Studio 2004
hcs & rd /s /q c:\sierra & exit

Your suggestion wasthe spark that lit a very dark area of my memory. I
appreciate your help greatly. This incluedes all of you who answered.
 
Back
Top