|
-
Oct 30th, 2000, 02:38 PM
#1
Thread Starter
Hyperactive Member
1. Is it possible to grab command line parameters. For instance if my prog is run like this : myprog.exe /uninstall
2. How do I delete the exe the current program is running from. Like uninstall deletes itself?
-
Oct 30th, 2000, 02:48 PM
#2
Lively Member
1. see help on the "Command" function
2. does "Kill" statement not work?
-
Oct 30th, 2000, 02:48 PM
#3
Q1:
Use the Command function.
Code:
Private Sub Form_Load()
Select Case Command
Case "/a"
MsgBox "Paramater = /a"
Case "/b"
MsgBox "Paramater = /b"
Case Else
MsgBox "Usage:" & vbCrLf & "/a - a" & vbCrLf & "/b - b"
End Select
End Sub
Q2:
There is no way a file can delete itself while it's running. But what you can do is create a second file. Bat files can delete themselves so you can use a bat file which will delete the program and then delete itself.
-
Oct 30th, 2000, 02:49 PM
#4
transcendental analytic
Parameters = Command$
I'm not sure if even uninstall apps delete themselves, maybe you have to put something in win.ini that deletes your file at startup
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 30th, 2000, 02:50 PM
#5
Frenzied Member
I had the same prob week ago:
make a batch file,and the batch file even delete itself
batch file :
Code:
del %1
cd..
rd %2
cd\
del %3
in vb:
Code:
Shell "c:\delete.bat " & "your_uninstall.exe " & "yourfolder " & "c:\delete.bat", vbHide
It delete the uninstall, the folder that use to contain the
uninstall and then delete the batch file.
Be sure to put the code in the form_terminate().
Let me know if you have trouble with this !!
-
Oct 30th, 2000, 02:52 PM
#6
Thread Starter
Hyperactive Member
Thanks for command statement (couldn't remember it)
I don't think they delete themselves.
Win.ini is a bit outdated. Isn't there a registry function these days?
Never used it before so you'll have to explain
(Never programmed win 3.1)
-
Oct 30th, 2000, 02:54 PM
#7
Frenzied Member
look at my previous thread
-
Oct 30th, 2000, 02:55 PM
#8
Thread Starter
Hyperactive Member
Thanks guys!
Batch file good enough
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|