7 Replies - 1474 Views - Last Post: 27 July 2008 - 06:55 PM Rate Topic: -----

#1 tssguy123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-July 08

I have looked EVERYWHERE!

Posted 18 July 2008 - 09:16 AM

I am looking to create a simple .exe that deletes a folder (C:/Program Files/World Of Warcraft/Cache), and then Opens the .exe C:/Program Files/World Of Warcraft/WoW.exe

Posted Image

Oh...

My problem is I do not know the code for either buttons.

I tried OPEN 'WoW.exe for input'


By the way, I just started VB6 yesterday by making my own browser.

Yesssss!

I got the .exe to run with

Private Sub cmdExec_Click() ' cmdExec is the name of the command button on any form.

Dim RetVal

RetVal = Shell("C:\Program Files\World Of Warcraft\WoW.exe", 1)	' Run WoW.

 

End Sub


This post has been edited by tssguy123: 18 July 2008 - 09:51 AM


Is This A Good Question/Topic? 0
  • +

Replies To: I have looked EVERYWHERE!

#2 PixelCard  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 48
  • View blog
  • Posts: 139
  • Joined: 20-June 08

Re: I have looked EVERYWHERE!

Posted 18 July 2008 - 12:46 PM

Try the code to delete the folder:

Dim fSystemObject As New Scripting.FileSystemObject
fSystemObject.DeleteFolder "C:\Program Files\World Of Warcraft\Cache", True



Why do you use the RetVal to execute a shell command? Try just executing the shell command:

Shell("C:\Program Files\World Of Warcraft\WoW.exe", 1)


This post has been edited by PixelCard: 18 July 2008 - 12:50 PM

Was This Post Helpful? 0
  • +
  • -

#3 saurabhv  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 18-July 08

Re: I have looked EVERYWHERE!

Posted 18 July 2008 - 12:53 PM

View Posttssguy123, on 18 Jul, 2008 - 09:16 AM, said:

I am looking to create a simple .exe that deletes a folder (C:/Program Files/World Of Warcraft/Cache), and then Opens the .exe C:/Program Files/World Of Warcraft/WoW.exe

Posted Image

Oh...

My problem is I do not know the code for either buttons.

I tried OPEN 'WoW.exe for input'


By the way, I just started VB6 yesterday by making my own browser.

Yesssss!

I got the .exe to run with

Private Sub cmdExec_Click() ' cmdExec is the name of the command button on any form.

Dim RetVal

RetVal = Shell("C:\Program Files\World Of Warcraft\WoW.exe", 1)	' Run WoW.

 

End Sub



it is quite easy

here

create a button and change its name to "delete" without quotes and the put the following code in your code module:

[code]
Private Sub delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles delete.Click

My.Computer.FileSystem.DeleteDirectory("address of the folder you want to delete", FileIO.DeleteDirectoryOption.DeleteAllContents, FileIO.RecycleOption.SendToRecycleBin, FileIO.UICancelOption.DoNothing)
End Sub

now run the code and if it does what you want it to do then click on the Build menu on top, and then select Publish [Your application name] and now follow the wizard.

Hope it helped
Was This Post Helpful? 0
  • +
  • -

#4 PixelCard  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 48
  • View blog
  • Posts: 139
  • Joined: 20-June 08

Re: I have looked EVERYWHERE!

Posted 18 July 2008 - 12:59 PM

View Postsaurabhv, on 18 Jul, 2008 - 12:53 PM, said:

View Posttssguy123, on 18 Jul, 2008 - 09:16 AM, said:

I am looking to create a simple .exe that deletes a folder (C:/Program Files/World Of Warcraft/Cache), and then Opens the .exe C:/Program Files/World Of Warcraft/WoW.exe

Posted Image

Oh...

My problem is I do not know the code for either buttons.

I tried OPEN 'WoW.exe for input'


By the way, I just started VB6 yesterday by making my own browser.

Yesssss!

I got the .exe to run with

Private Sub cmdExec_Click() ' cmdExec is the name of the command button on any form.

Dim RetVal

RetVal = Shell("C:\Program Files\World Of Warcraft\WoW.exe", 1)	' Run WoW.

 

End Sub



it is quite easy

here

create a button and change its name to "delete" without quotes and the put the following code in your code module:

[code]
Private Sub delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles delete.Click

My.Computer.FileSystem.DeleteDirectory("address of the folder you want to delete", FileIO.DeleteDirectoryOption.DeleteAllContents, FileIO.RecycleOption.SendToRecycleBin, FileIO.UICancelOption.DoNothing)
End Sub

now run the code and if it does what you want it to do then click on the Build menu on top, and then select Publish [Your application name] and now follow the wizard.

Hope it helped


He is using VB6, not .NET, so the above code won't work in this case.

Quote

now run the code and if it does what you want it to do then click on the Build menu on top, and then select Publish [Your application name] and now follow the wizard.


By the way, why should the topic starter publish his application, huh?

This post has been edited by PixelCard: 18 July 2008 - 01:05 PM

Was This Post Helpful? 0
  • +
  • -

#5 tssguy123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-July 08

Re: I have looked EVERYWHERE!

Posted 23 July 2008 - 03:01 PM

Well, I got it working.
I was wondering what code I could use to make a popup well popup when You click the delete button that says Deleted or Are You Sure you want to delete? Y/N

Just some sort of confirmation..
Was This Post Helpful? 0
  • +
  • -

#6 KyleG  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 44
  • Joined: 11-June 08

Re: I have looked EVERYWHERE!

Posted 23 July 2008 - 03:29 PM

Doesn't anybody use batch files any more?

Step 1: Create a new text file with notepad
Step 2: Type these two lines into the text file, quotes and all:
RMDIR /S "C:\Program Files\World Of Warcraft\Cache"
"C:\Program Files\World Of Warcraft\WoW.exe"


Step 3: Save and close the text file
Step 4: Rename the file to WhateverYouWant.bat
Step 5: Double-click the file to run it just like any other program
Was This Post Helpful? 0
  • +
  • -

#7 tope10  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 23
  • Joined: 26-June 08

Re: I have looked EVERYWHERE!

Posted 26 July 2008 - 01:50 AM

Quote

I just made to code for deleting the folder and for starting the application/
before you execute the program add the dll "Micrsoft Scripting Runtime Library". To add the dll goto project menu then references, locate the said dll and check it and click ok, then run the program..


Dim fsodelete As New FileSystemObject
Dim ans As VbMsgBoxResult
Private Sub cmdDeleteCache_Click()
	ans = MsgBox("Sure you want to delete the cache files?", vbQuestion + vbYesNo)
	
	If ans = vbYes Then
		fsodelete.DeleteFolder "C:/Program Files/World Of Warcraft/Cache", True
	End If
End Sub

Private Sub cmdStart_Click()
	Shell "C:/Program Files/World Of Warcraft/WoW.exe", vbNormalFocus

End Sub




:)
Was This Post Helpful? 0
  • +
  • -

#8 tssguy123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-July 08

Re: I have looked EVERYWHERE!

Posted 27 July 2008 - 06:55 PM

View PostKyleG, on 23 Jul, 2008 - 03:29 PM, said:

Doesn't anybody use batch files any more?

Step 1: Create a new text file with notepad
Step 2: Type these two lines into the text file, quotes and all:
RMDIR /S "C:\Program Files\World Of Warcraft\Cache"
"C:\Program Files\World Of Warcraft\WoW.exe"


Step 3: Save and close the text file
Step 4: Rename the file to WhateverYouWant.bat
Step 5: Double-click the file to run it just like any other program



I wanted it to have some sort of GUI.

Thats why.

This was inspired by a batch file, but I wanted to improve it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1