Quantcast

Maximum PC

It is currently Tue Sep 23, 2014 6:30 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: DOS BATch programming
PostPosted: Tue Sep 14, 2004 7:16 pm 
8086
8086

Joined: Tue Sep 14, 2004 6:46 pm
Posts: 21
Location: California
I created an install routine using WINZIP9, and an uninstall batch program, though the .BAT file is giving me fits:

APPDELETE

ECHO Y| DEL C:\PROGRA~1\APP
ECHO Y| RMDIR C:\PROGRA~1\APP
ECHO Y| DEL C:\WINDOWS\DESKTOP\APP.LNK
ECHO Y| DEL C:\WINDOWS\STARTM~1\PROGRAMS\APP
ECHO Y| RMDIR C:\WINDOWS\STARTM~1\PROGRAMS\APP
DEL C:\PROGRA~1\APPDEL~1.BAT
@echo off
CLS

Now, everything works fine, but it does not delete itself. Any help would be greatly appreciated.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Sep 15, 2004 7:53 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Wed Jun 16, 2004 11:30 am
Posts: 368
Location: San Antonio, TX
I know it is possible to delete the file you are running but I am not sure how to do it. I tried googling but couldn't find a quick clear sample. It should be as simple as executing the del command like you have so I have no clue why it isn't working properly.


Top
  Profile  
 
 Post subject: Re: DOS BATch programming
PostPosted: Wed Sep 15, 2004 2:19 pm 
I'd rather be modding!
I'd rather be modding!
User avatar

Joined: Fri Jun 25, 2004 3:47 pm
Posts: 3731
Location: Las Vegas
vicismar wrote:
I created an install routine using WINZIP9, and an uninstall batch program, though the .BAT file is giving me fits:

APPDELETE

ECHO Y| DEL C:\PROGRA~1\APP
ECHO Y| RMDIR C:\PROGRA~1\APP
ECHO Y| DEL C:\WINDOWS\DESKTOP\APP.LNK
ECHO Y| DEL C:\WINDOWS\STARTM~1\PROGRAMS\APP
ECHO Y| RMDIR C:\WINDOWS\STARTM~1\PROGRAMS\APP
DEL C:\PROGRA~1\APPDEL~1.BAT
@echo off
CLS

Now, everything works fine, but it does not delete itself. Any help would be greatly appreciated.


I would try two things:

Name the batch file with 8 character convention (likecall it APPDEL.BAT)
.
make DEL C:\PROGRA~1\APPDEL.BAT the last line of code.

Does that work?

Manta


Top
  Profile  
 
 Post subject: DOS BATch Answer
PostPosted: Mon Sep 20, 2004 6:02 pm 
8086
8086

Joined: Tue Sep 14, 2004 6:46 pm
Posts: 21
Location: California
Many thanks to those who replied.
A few suggetstions from offline sources pointed out that the batch file did not self-terminate because of the last two lines of code, I.E: how could it delete itself if it was still runnung?! Problem 1 solved. The second problem, the reason for those two lines code, was that the DOS window did not close after it was done. The answer for this one lay in the shortcut leading to it. The attribute -Close On Exit- had to be set during the shortcut's creation.

Again, many thanks.

DOS RULZ ;-)


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group