|
-
Jul 13th, 2001, 05:53 AM
#1
Thread Starter
-= B u g S l a y e r =-
you want your program to shut down and then reload ?
-
Jul 13th, 2001, 05:54 AM
#2
Addicted Member
what do u mean form DOS???
i guess if u have made ur app into and .exe it should be posible!
-
Jul 13th, 2001, 06:17 AM
#3
Frenzied Member
Code:
Option Explicit
Private Sub Command1_Click()
Dim fNum As Integer
Dim fName As String
fName = App.Path & IIf(Right(App.Path, 1) = "\", "", "\") & "restart.bat"
fNum = FreeFile
If Dir(fName) <> "" Then
Kill fName
End If
Open fName For Output As fNum
Print #fNum, App.Path & "\" & App.EXEName
Print #fNum, , "del " & fName
Close #fNum
Shell fName, vbHide
Unload Me
End Sub
-
Jul 13th, 2001, 06:55 AM
#4
Thread Starter
-= B u g S l a y e r =-
Mark Sreeves
it didn't work ... nothing happend it just shut down
-
Jul 13th, 2001, 07:08 AM
#5
Frenzied Member
Originally posted by peet
Mark Sreeves
it didn't work ... nothing happend it just shut down
Did you compile it to an exe?
-
Jul 13th, 2001, 07:12 AM
#6
Thread Starter
-= B u g S l a y e r =-
yes compiled it to an exe and executed the exe
-
Jul 13th, 2001, 07:16 AM
#7
Thread Starter
-= B u g S l a y e r =-
uh.. I'm a stupid person... 
I didn't think about the long filename issue... I placed the project and exe in a folder with long filename...
I moved it to c:\test and everything works like a charm !!!
thanks!
should be aware of the long filename issue though ...
-
Jul 13th, 2001, 02:37 PM
#8
Frenzied Member
Just Use:
VB Code:
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long
Public Function GetShortPath(strFileName As String) As String
Dim lngRes As Long, strPath As String
'Create a buffer
strPath = String$(165, 0)
'retrieve the short pathname
lngRes = GetShortPathName(strFileName, strPath, 164)
'remove all unnecessary Chr$$(0)'s
GetShortPath = Left$(strPath, lngRes)
End Function
Private Sub Command1_Click()
Dim fNum As Integer
Dim fName As String
fName = App.Path & IIf(Right(App.Path, 1) = "\", "", "\") & "restart.bat"
fNum = FreeFile
If Dir(fName) <> "" Then
Kill fName
End If
Open fName For Output As fNum
Print #fNum, GetShortPath(App.Path) & "\" & App.EXEName
Print #fNum, , "del " & fName
Close #fNum
Shell fName, vbHide
Unload Me
End Sub
-
Jul 13th, 2001, 06:16 PM
#9
Thread Starter
-= B u g S l a y e r =-
Great Mark Sreeves and shragel not it works anywhere on my disk 
thanks
-
Jul 13th, 2001, 07:12 PM
#10
PowerPoster
You mis-spelled "now".
heh...always slapping you in the face with a dictionary.
-
Jul 13th, 2001, 07:26 PM
#11
Thread Starter
-= B u g S l a y e r =-
-
Jul 13th, 2001, 07:28 PM
#12
PowerPoster
-
Jul 13th, 2001, 07:30 PM
#13
Thread Starter
-= B u g S l a y e r =-
that was a cheap one ... this one on the other hand. ...
-
Jul 13th, 2001, 07:31 PM
#14
PowerPoster
-
Jul 13th, 2001, 07:33 PM
#15
Thread Starter
-= B u g S l a y e r =-
your gonna get us both kicked out of here
-
Jul 13th, 2001, 07:33 PM
#16
PowerPoster
not if you do it first!
-
Jul 13th, 2001, 07:36 PM
#17
PowerPoster
-
Jul 13th, 2001, 07:38 PM
#18
Thread Starter
-= B u g S l a y e r =-
hey thats a new one "g2g" .. Still learning some usefull things 
cya ! (god damn I'm cool)
-
Jul 13th, 2001, 09:39 PM
#19
PowerPoster
-
Jul 13th, 2001, 09:39 PM
#20
PowerPoster
by the way, g2g means "got to go"
-
Jul 13th, 2001, 09:40 PM
#21
PowerPoster
heh...even more posts...
-
Jul 14th, 2001, 10:39 PM
#22
Frenzied Member
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
|