|
| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
Running batch files from a cd
|
Original Message
|
Name: Phil
Date: August 24, 2002 at 16:01:14 Pacific
Subject: Running batch files from a cd |
Comment: I am creating a cd with all the latest patches and programs that I install on my domain. To make things easier I am using Microsoft's hfnetchk program to check which patches the particular computer I'm looking at are missing. normally when you execute the exe from windows it just zips through the check and the window closes. So I wrote a batch file to include the pause command at the end which is enough to keep the screen up. This batch file works great off the hard drive but when I go to burn it on to CD, it can't find the executable even though the two were in the same directory with each other in both situations. I am accessing the batch file from a webpage that I have set up to reference the files. When I go to access the batch file directly off the cd it works fine. So my problem is when accessing it from the webpage. The webpage on the hard drive works fine, I am able to access the program. Any help is much appreciated.
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: CleoTechtra
Date: August 24, 2002 at 20:18:38 Pacific
|
Reply: (edit)Ok, hold on, Every other line you wrote up there is saying the exact opposite of the line before it! What do you mean when you say it can't find the exe when you go to burn it? Does this mean you can or you can't run the batch file from the CD? Also, can you or can't you access from the webpage? And if you can, what exactly do you mean by that? It's all very hazy but it sounds as if there is a path error somewhere. Have you set up the webpage to reference the files from the hard drive or from the CD? Please clarify, Cleo
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: Phil
Date: August 25, 2002 at 10:58:04 Pacific
|
Reply: (edit)Sorry if I sounded unclear. Everything works great from the hdd. I run the web page it references everything correctly. Now its on CD, I can run the batch file if I go directly to the batch file on the cd, that works fine. Now the webpage that I've created to reference everything off the cd is open...I go to click on the link to my batch file...the batch file runs, but is unable to find the exe. This is the message I get, "'hfnetchk.exe' is not recognized as an internal or external command, operable program or batch file." Short of telling the computer to look at the exact directory, which I'm unsure of how to do that since not all systems have the same drive letter for their cd rom drives. If I had a generic way to refer to the cd drive then I think I'd have no problem. Thanks for any help you can provide in advance.
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: CleoTechtra
Date: August 25, 2002 at 13:35:09 Pacific
|
Reply: (edit)Ah, I see , I see. I'm assuming that you're trying to find a quick way to make sure that all your users are up to date on their patches. Great idea. You know what though, Phil, insead of trying to second guess every drive letter from E: to Z: and also to avoid spending a lot of time dealing with errors, why don't you just write a command into the batch file that will copy the executible from the CD to the hard drive then change the path to run it from C:\hfnetchk.exe instead of the CD Rom? If the command originates from the CD it won't matter what the rom drive letter is and the hard drive will always be C: What do you think? Cleo
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: Phil
Date: August 26, 2002 at 20:49:12 Pacific
|
Reply: (edit)I can see that working, but every time that batch file runs its going to copy everything over. During the process of loading all the patches you have to reboot about every patch so to make sure all the patches made it on I rerun the utility to make sure I am still taking them off the list of missing patches as I run down the list of patches to run. One option I guess I could use is add another batch file, one to execute the utility the other to copy the utility. Then I could annotate the two to show that one copies the files the other executes. I can see that as a solution, but I'd like to keep from putting those files on the HDD, but if thats the only option I'm able to come up with then I will go with this one. Thanks for your time, having someone to talk things out makes it a lot easier to solve these issues. Being the only IT specialist here right now makes it difficult to get other opinions. Thanks Phil
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
Name: CleoTechtra
Date: August 27, 2002 at 08:18:18 Pacific
|
Reply: (edit)Hi Phil, You don't even have to go that far, just put a "del c:\hfnetchk.exe" command at the end of the batch file. The only thing you'll be doing is deleting the executible, you won't be undoing any of your previous actions. Think of when you download some little program off the internet, it may come in a zip file or just a small executible but once you extract the files and run the setup, you can delete the original downloaded file with no effect whatsoever on the program. The same is true here. Try it, I think you'll like it! Cleo
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: Phil
Date: August 27, 2002 at 09:47:49 Pacific
|
Reply: (edit)Cleo, I pose one more question how do I get the copy command to work with all systems, i.e., a computer that has a cd rom drive of say f:. That would work great I just need to know how to specify the directory. Thanks Phil
Report Offensive Follow Up For Removal
|
|
Response Number 7
|
Name: CleoTechtra
Date: August 28, 2002 at 17:43:42 Pacific
|
Reply: (edit)Tricky, tricky, I am very curios about this issue. Tell me: 1. How are you initially finding the CD-Rom to launch the batch file? 2. Are the batch file and the .ex seperate on the CD or are they both in a folder on the CD? 3. What does the line calling the hfnetchk.exe file look like? Can you give me an example? CT
Report Offensive Follow Up For Removal
|
|
Response Number 8
|
Name: Phil
Date: August 29, 2002 at 08:09:44 Pacific
|
Reply: (edit)1. I initially place the cd in the drive and it will autorun bringing up a webpage of the cd. Or I go into the cd and open the page that way. Next I click on the link and it prompts me to open or save the bat file. I open it and then error out. 2. No the batch file and exe are in the same location e:\hfnetchk. That's the drive letter for my computer. 3. Here's what I have on the cd now. call hfnetchk.exe pause Here's what I've come up with that will work but need a wildcard so it'll work on other computers. xcopy e:\hfnetchk c:\net /I call c:\net\hfnetchk.exe pause rd /S /Q c:\net In order to make this friendly I'll probably have to add a couple lines because some of the commands are different for the other os's. Hope this helps Phil
Report Offensive Follow Up For Removal
|
|
Response Number 9
|
Name: CleoTechtra
Date: August 29, 2002 at 19:15:45 Pacific
|
Reply: (edit)I see a command that makes perfect sense but that I've had lots of trouble with in the past. I still don't have the big picture but this may have somethng to do with it; Try changing the line that reads: xcopy e:\hfnetchk c:\net /I to copy e:\hfnetchk\*.* c:\net /I Tell me what happens...
Report Offensive Follow Up For Removal
|
|
Response Number 10
|
Name: Phil
Date: August 30, 2002 at 10:55:25 Pacific
|
Reply: (edit)I'm not having a problem copying the files, that works fine. The command you are giving me is essentially the same as xcopy the way you have entered it with the *.*. But I've found another way around it rather than call the command to copy when I want it to, it does so automatically when I pop the cd in the drive. I've added the xcopy command to the autorun.bat file so when the cd spins up it copys the files over to the c: drive and then once I'm ready to use hfnetchk I click on the link, the link goes to a .bat file on the cd which references the program that is now on the c: drive. So rather than spend any more time on the situation I think I'll call it good. Thanks for all your thoughts. I got this idea from Rob van der Woude. He has a web site that deals basically with scripting. He couldn't give me a wildcard for the cdrom, but this works just as well. You can go to http://www.robvanderwoude.com. It's got a lot of helpful info on .bat files and scripting. Thanks Phil
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Windows 2000 Forum Home
|
|
|