![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Caffeinated Neural Net
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 895
Rep Power: 4
![]() |
Quote:
He has told me they use a scripting suite called AutoIt, which according to him, is very useful for doing the job. In fact, it was originally designed for just this sort of task. I've never used it myself, so this isn't an endorsement, but it is free and may meet your needs. For more details, clickie.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp |
|
|
|
|
|
|
#12 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
lectricpharaoh - The program you talk about is another method of doing the same thing, but i prefer this one.
Below is some code, and also the code for the batch file: VB.net: 'Check weather to install Google If CheckGoogle.Checked = True Then Dim a a = Shell("C:/Documents and Settings/billy/Desktop/Google Toolbar/AI.cmd") The file launch's fine remember, but the batch reports that the file cannot be found. The batch file code: (note that the actuall file is located in the same folder as AI.cmd) @ECHO Off ECHO. ECHO Installing Google Toolbar ECHO Please Wait... start /wait GoogleToolbarInstaller.exe /qb ECHO Completed. EXIT Hope this helps you help me ![]() |
|
|
|
|
|
#13 |
|
Expert Programmer
|
It will default to the current directory, so
.StartInfo.FileName = "AFile.cmd" You could also try .StartInfo.FileName = ".\AFile.cmd" .StartInfo.FileName = AppDomain.CurrentDomain.SetupInformation.ApplicationBase() & "\AFile.cmd" What is the error precisely: is it a .NET exception, or is it a standard windows error message? Ultimately, VB.NET is just calling the ShellExecute API like every other program. If it's not working, it means the path or permissions are incorrect, or windows is not correctly set up to execute that type of file. |
|
|
|
|
|
#14 |
|
Expert Programmer
|
You just posted at the same time!
Again, it's not a problem with VB! You need to specify the working directory for the command prompt (probably %SystemRoot%) as you are using relative paths in your batch file. .StartInfo.WorkingDirectory = "folder where the batch file needs to run in" Arguably you should check this within your batch file rather than the launcher program, but anyway... |
|
|
|
|
|
#15 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Your code rory was used aswell, it gave the same error. The error is a standard windows error of the file cannot be found...
The working directory can't be set that way, as each Batch file has its own folder: For example: CD >> Program Folders >> Program.exe & AI.cmd there is nothing but the actuall program in the cd's main dir. |
|
|
|
|
|
#16 |
|
Expert Programmer
|
Hmm, I'm still unable to see what you can do in a batch file that you can't do 100 times better in VB.NET.
|
|
|
|
|
|
#17 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Rory if you can show me an example of using the same method in VB.net i'd be happy to try it
![]() |
|
|
|
|
|
#18 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Problems all sorted thanks to Rory.
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|