![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Open File Problem :(
Hello everybody..i'm knew here and looking for a bit of help..heres my problem:
I am in the process of building a program to Install some programs silently from a PC. this program is basically a GUI that will start a few batch files that actually install the programs. The main issue is with a = Shell("""\Google Toolbar\AI.cmd""") or anything similar, the program will succesfully load up the batch file, however the batch file will then say "GoogleToolbarInstaller.exe cannot be found. I Know there is no issue with the actuall batch file because it works fine if it is ran alone. Anyone with any suggestions please post, i'm at the end of my teather with this problem. Thanks alot |
|
|
|
|
|
#2 |
|
Expert Programmer
|
You seem to be using a relative path with quotes: for long filenames you need a dot, or you can form the absolute path "manually". However on Windows NT and later, BAT PIF and CMD are no longer natively executable. Try the ShellExecute API / whatever the .NET FW wrapper is, or you can use the inbuilt Shell "command.com /c batchfile". However in VB.NET you shouldn't be relying on VB6 compatibility namespaces containing hangover aliases, and you also lose some functionality.
|
|
|
|
|
|
#3 |
|
Expert Programmer
|
dude your messed up!!! i cannot stand stupid little shit like that... why in the hell would anyone help this guy silenting install programs on your machine... this is an ongoing problem wih people now and days.. i don't even know what to say excpet, you need go back to school, get a degree and learn to make an honest living. What you are trying to do should be against a privacy policy with microsoft or something. stupid shit man... stupid shit
__________________
"When in Rome, Do as the Romans Do" "Beauty is in the eye of the BEER holder" "Save your breath your going to need it for your blow up doll later" SearchLores.org |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Kilo: Please stfu, and read:
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) So if you've finished saying "Stupid Shit", why don't you think about what your saying you dick. Rory: Thanks for your reply, however i'm a bit of a novice, i'm on a course at the moment in programming... Can you explain what the .net FW wrapper is? Shell "command.com /c batchfile << how does this work? is it the same as "A = Shell ("/FileDir/File.exe")? Thanks |
|
|
|
|
|
#5 |
|
Expert Programmer
|
Silent, what I meant was that the Shell command is simply a shortcut method for people experienced with VB6 which hides a lot of the improved native functionality you get with the .NET Framework (FW). Microsoft.VisualBasic.Interaction.Shell() will only execute natively executable files (.exe, .com) whereas the Process class enables you to call the ShellExecute API to launch so-called "helper" applications:
Dim AProcess As System.Diagnostics.Process = New System.Diagnostics.Process
With AProcess
.StartInfo.FileName = "C:\Windows\Gone Fishing.bmp"
.StartInfo.UseShellExecute = True
.Start()
End WithThe important line is .StartInfo.UseShellExecute = True, you are instructing the class that the file is not directly executed, but run with another program defined in the registry (probably paint), whereas you cannot do this simply using the Shell method. In your case you can substitute .StartInfo.FileName = "somefile.cmd" as command.com is the helper app for those files, which will run as if you double clicked them. N.B. you may need to specify the absolute path - AppDomain.CurrentDomain.SetupInformation.ApplicationBase() gives you the path the application is running from. |
|
|
|
|
|
#6 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 290
Rep Power: 4
![]() |
Flame on Silent and Kilo!
Flame on...... I do see your point for making such a program, but as I too make computers, sometimes its best to use Ghost for Imaging computers, but I guess if you are just installing Ad-Aware and other small, none hardware dependent programs, it makes sense....who do you work for? |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Ghost:
I Work for a medium sized company in England. Its called Halifax Computers Ltd (www.halifaxcomputers.co.uk) Rory: Many thanks, I've give your code a going at but still no luck. It gives the same error as i started with, (the one with the batch file saying it couldn't find the file specified, yet it works fine when ran by the user) Any other idea's? Thanks again |
|
|
|
|
|
#8 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Rory:
I've been having a look to see what other problems it could be and, found it can't be any of these: CD Problem - I Tryed executing the batch on a Hard Drive Batch File - Tested and Fine Therefore, it must be something to do with VB. there is no other explanation... ![]() |
|
|
|
|
|
#9 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 290
Rep Power: 4
![]() |
Why not put the batch files and all setup.exe files in the same folder so you can do relitive paths? I'm not sure if that is the issue, but its a thought.
EDIT: Also, for the CD purposes are you telling the program to pic the same drive it is on, try debugging and see where the strings lead you. |
|
|
|
|
|
#10 |
|
Newbie
Join Date: Nov 2005
Posts: 11
Rep Power: 0
![]() |
Yes ghost, The program is set so it opens it from the current dir.
The reason the "setup.exe" and batch files aren't in the same Dir is because the disc has 2 use's and this isn't workable. (Don't Ask) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|