Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 2nd, 2005, 9:26 PM   #11
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,183
Rep Power: 5 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by Silent
This program is being made for my job, i build around 8 PC's a day. We normaly use Norton Ghost to ghost the same image to the same Motherboard type PC, eg, if the components are the same, we just ghost. However sometimes we have to build with boards we don't have a ready made ghost image for, therefore, i am making this program to install quickly the normal tools we put on PC's to help the noobies keep there PC ok. (AdAware Etc)
A friend of mine works for a local college as a 3D animation teacher, and also has to perform some of the software installations and updates on the machines in the class lab. Ghost isn't a suitable solution, as some of the machines have sublty different hardware, and software licenses on the machines have to be unique. It seems you're in much the same sort of situation.

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.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Dec 3rd, 2005, 11:16 AM   #12
Silent
Newbie
 
Join Date: Nov 2005
Posts: 11
Rep Power: 0 Silent is on a distinguished road
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
Silent is offline   Reply With Quote
Old Dec 3rd, 2005, 11:24 AM   #13
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
It will default to the current directory, so
.StartInfo.FileName = "AFile.cmd"
should just work.
You could also try
.StartInfo.FileName = ".\AFile.cmd"
or
.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.
Rory is offline   Reply With Quote
Old Dec 3rd, 2005, 11:28 AM   #14
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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...
Rory is offline   Reply With Quote
Old Dec 3rd, 2005, 11:53 AM   #15
Silent
Newbie
 
Join Date: Nov 2005
Posts: 11
Rep Power: 0 Silent is on a distinguished road
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.
Silent is offline   Reply With Quote
Old Dec 4th, 2005, 12:05 PM   #16
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Old Dec 4th, 2005, 12:12 PM   #17
Silent
Newbie
 
Join Date: Nov 2005
Posts: 11
Rep Power: 0 Silent is on a distinguished road
Rory if you can show me an example of using the same method in VB.net i'd be happy to try it
Silent is offline   Reply With Quote
Old Dec 5th, 2005, 3:30 AM   #18
Silent
Newbie
 
Join Date: Nov 2005
Posts: 11
Rep Power: 0 Silent is on a distinguished road
Problems all sorted thanks to Rory.
Silent is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:17 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC