Login | |
|
 |
RE: What can VBs do that .bat files can't? - 7/11/2007 2:47:42 PM
|
|
 |
|
| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
I use a vbs login script to mount drives, add printers (if they dont already exist) and use the built in text-to-speech to say hello :) could you do most of this with a batch file? probably, except the printer and the ear candy as a general rule of thumb, I use vbs for more advanced scripts and batch for the quick and dirty ones
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/11/2007 2:58:55 PM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
Batch can be used to install printers, mount drives, and most anything else. It is much more robust than most people give it credit for, but vbscript is even more robust, in a different manner. Batch printer install: rundll32 printui.dll,PrintUIEntry /p /n\\machine\printer RUNDLL32 PRINTUI.DLL,PrintUIEntry /? to get parameters Batch mount drives: net use z: \\blahblahblah\share
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/12/2007 9:39:57 AM
|
|
 |
|
| |
Parabellum
Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
|
It is possible to do this with vbscript...although.... this functionality is already built into 2003 Server, try here for starters.. http://support.microsoft.com/kb/816102
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/12/2007 9:46:43 AM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
Installing things remotely and running scripts remotely is the reason I wrote TheGrimLinker. It doesn't support pulling PC's from AD just yet but I'm working on it. For now you use a list file with pc names in it. I have installed Lotus Notes, Java Runtime, Removed Yahoo Toolbar, Google Desktop, and many other things on thousands of pc's using it. Keep in mind it's not perfect, but if you want to try it out, click my siggy and I'll help you out all you want. With TheGrimLinker, if you can write a script that runs locally (you just wrote a script that can be run remotely)
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/12/2007 8:24:35 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
Parabellum Just what I was looking for
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/13/2007 12:07:50 AM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
Parabellum nice script, but the reason I haven't incorporated it yet is that my needs are quite complicated. I need to pull all PC's from AD. Then I need to provide a way (Filter) of limiting the PC's a user wants to run the script against by Domain, OU, operating system. They need to be able to select any combination and get the correct PC's. I need this info to be written to a file preferrably xml, so that AD is not polled each and every time. Then I need to give them the ability to "freshen" the file by requerying AD when they choose. Simply put I need what ginolard has in ManagePC, but even more robust. Think you can whip me up one of those?
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/13/2007 3:18:11 AM
|
|
 |
|
| |
mcds99
Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
|
From another perspective you learn a large part of Visual Basic; this will help in day to day work in other areas like automating MS Office applications, reporting from databases, workstation management, and others. Batch files (.bat or .cmd) are great, I started using .bat's in the DOS 3.x days BW (Before Windows). With the advent of VBS and now PS (PowerShell) I think Microsoft has depreciated the use of batch processing using .bat and .cmd. Not so much by design but by accident. I still have my DOS 3.x Que book ;-)
_____________________________
Sam Keep it Simple Make it Fun KiSMiF
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/13/2007 6:28:43 AM
|
|
 |
|
| |
Fredledingue
Posts: 383
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
-Long file name support. -Invisible mode (try running a batch file without the prompt - the only way I know is... through a vbs) -better sleep method -better text manipulation -send keys However, what bat can do and vbs can't is "DIR". That's realy something missing in VBS.
_____________________________
Fred
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/13/2007 6:43:09 AM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
Neither is necessarily better than the other. Each has it's use and it's place. One advantage batch has over vbs, is the fact that it is natively updated with the OS (kernel and command interpreter = update to batch language), whereas vbs and wsh require installs depending on version and OS. I agree with mcds99, vbs does help learn VB (to a point), and since vbs is formatted and syntaxed more like a compiled language. If you learn good practice it is easier to maintain a large code base in vbs. Oh, and don't ever try to run vbs from a boot floppy..... ROFLMAO..... You need WINPE, or BARTPE for that.
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/14/2007 12:43:57 AM
|
|
 |
|
| |
Fredledingue
Posts: 383
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
Xhen did M$ update DOS the last time?
_____________________________
Fred
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/14/2007 3:50:27 AM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
There is no more TRUE DOS..........
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/14/2007 11:15:31 AM
|
|
 |
|
| |
Fredledingue
Posts: 383
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
Ok, when did M$ update the "command interpreter"?
_____________________________
Fred
|
|
| |
|
|
|
 |
RE: What can VBs do that .bat files can't? - 7/14/2007 12:45:51 PM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
Well specifically the last update to the command interpreter itself was some updates and bug fixes for the "FOR" command. More importantly A "DOS" was defined as having internal and "External" commands. External commands are standalone executables. So any time either an internal or external command is updated or newly created it constitutes an update.
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
|
|