![]() |
|
|||||||
| Deployment Discussions related to installation, patching/updates, no touch deployment, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hello everybody!
i have a problem. What i want is that i can include a file (a bat or something) and that i can say in my code Shell("clean.bat") without that file being in the same folder as my exe. How do i do that?
|
|
|||
|
what i want is to embed the file in my exe and that i can execute my .bat with shell("clean.bat") anybody know? nvm, did it otherwise
Last edited by bobbel; 11-04-2008 at 5:27 PM. |
|
||||
|
Before you can run a file like that you need to make a copy of it outside your exe file, you can use a FileStream to copy it out of the resources, then run it using Process.Start("Path to file")
__________________
There are 3 kinds of people in the world: Those who can count and those who can't.
Windows has a 64 bit GUI for a set of 32 bit extensions on a 16 bit shell for an 8 bit OS using a 4 bit kernel made by a 2 bit company that can't stand 1 bit of competition. For an extensive list of MS Service packs and extensions: http://www.juggalobrotha.com/ |
|
|||
|
well, what i did: when you press a button, it print a bat file that ends with "del clean.bat" and then executes it, so you can't read it and you nearly can't copy it
|
|
|||
|
Sorry if my guess is wrong. Judging by the name of your bat file. If you are deleting all files in a folder then you can use this.
Code:
For Each foundFolder As String In My.Computer.FileSystem.GetDirectories("C:\Test")
My.Computer.FileSystem.DeleteDirectory(foundFolder, FileIO.DeleteDirectoryOption.DeleteAllContents)
Next
For Each foundFile As String In My.Computer.FileSystem.GetFiles( "C:\Test", FileIO.SearchOption.SearchAllSubDirectories, "*.*")
My.Computer.FileSystem.DeleteFile(foundFile, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
Next
Last edited by shawnplr; 11-08-2008 at 8:06 PM. |
|
|||
|
Quote:
If you really want a batch file... and it must be part of the exe.. My work around would be to create a sub routine which actually creates a new batch file and writes the content to it. Then run the file and after the execution has completed, delete it. |
|
|||
|
Yes Leon he did just that.
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|