Advertisement

02.20.2007 at 10:51AM PST, ID: 22401633
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

WAKE ON LAN script/batch help

Tags: wake, lan, script
I need to run a script/ batch file to wake up (WOL) several hundred PCs ( DELL gx150, gx 260, gx 270 gx 620 - mostly Windows XP) in the middle of the night.
First -  the script needs to enable WOL feature on the mobo - this part has been solved - there is a nice tool from DELL to do this - and it works- with some limitations - (gx 270 and gx 150 need BIOS upgrade).
Second part -  is to send the wake up frame , packet , magic packet etc. (whatever they call it) from within the batch file to all the PCs and wake them up .
I have done some research over the net and there are many stand alone WOL applications that can wake a single PC by having the PCs MAC address and/or IP address. I need a script/ tool for many PCs at a time that can start WITHIN the batch file after the Enable-- WOL- in- BIOS part is completed.

Since I am not a script guru please, be more specific with your directions.

Thanks
Start your free trial to view this solution
Question Stats
Zone: Networking
Question Asked By: RICuser
Solution Provided By: oBdA
Participating Experts: 2
Solution Grade: A
Views: 286
Translate:
Loading Advertisement...
02.20.2007 at 11:28AM PST, ID: 18573147

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.20.2007 at 11:48AM PST, ID: 18573306

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.20.2007 at 11:56AM PST, ID: 18573357

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.20.2007 at 11:58AM PST, ID: 18573376

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.20.2007 at 12:04PM PST, ID: 18573434

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.20.2007 at 12:27PM PST, ID: 18573645

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.20.2007 at 02:24PM PST, ID: 18574687

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.20.2007 at 03:03PM PST, ID: 18574966

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.21.2007 at 11:00AM PST, ID: 18581021

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.26.2007 at 10:41AM PST, ID: 18611282

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.27.2007 at 01:56AM PST, ID: 18615674

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.05.2007 at 01:19PM PST, ID: 18657476

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
02.20.2007 at 11:28AM PST, ID: 18573147

Rank: Wizard

Assuming you have a list of the MAC addresses to process, you can do that with a "for /f" command.
"for /f" will read a file line by line and put the words found in the lines into variables (enter "help for" in a command window for details).
So something like this should do the trick:

@echo off
:: *** The file with the mac addresses to process:
set MacFile=C:\Temp\maclist.txt
for /f %%a in ('type "%MacFile%"') do ECHO wakeonlan.exe %%a

Replace "wakeonlan.exe" with the command line application of your choice, and add other parameters, if necessary. Use "%%a" where you would normally put the machine's MAC address.

Check http://www.robvanderwoude.com/ if you're looking for a nice website about batch scripting.
 
02.20.2007 at 11:48AM PST, ID: 18573306
What format should the maclist.txt have?

Does it have to look like the hosts file - a translation of IP address to MAC address ( and possibly host name) or just a list of MAC addresses separated by a space( tab) will do?

Thanks for your time.
 
02.20.2007 at 11:56AM PST, ID: 18573357

Rank: Wizard

Just a list of MAC addresses, one address per line, plain text format:
11-11-11-11-11-11
22-22-22-22-22-22
...

Forgot to mention that the script above is still in "test mode"; it will only display the wol command it would otherwise run. To run it for real, remove the capitalized "ECHO" in front of the exe call.
 
02.20.2007 at 11:58AM PST, ID: 18573376

Rank: Guru

... or you can grab a list of workstations on your network using
net view...

the format would be

\\workstation    /description/

So, something like

for /f "skip=3" %%a in ('net view') do call :process %%a
goto :eof

:process
set pc=%1
::and then continue as oBda has outlined above for processing the wol piece
 
02.20.2007 at 12:04PM PST, ID: 18573434

Rank: Wizard

Well, a list of host names won't really help for WOL ...
 
02.20.2007 at 12:27PM PST, ID: 18573645
oBda  :
 >>Replace "wakeonlan.exe" with the command line application of your choice>>

I think here is my problem - most of the applications out there are GUI based and require user input.
I am trying to find a wol application that can be called/started from the batch and when it starts should not display any interface and/or require user input. Any suggestions of any tool that is capable of doing that??
 
02.20.2007 at 02:24PM PST, ID: 18574687

Rank: Wizard

Just put this into google:
"wake on lan" "command line"
and check which one does the job for you.
 
02.20.2007 at 03:03PM PST, ID: 18574966
While working on this one I stumbled upon another issue:

There is a check box in the Power Management tab at the NICs Advanced property window that enables/allows  the NIC to bring up the computer out of stand by/sleep mode. Without this one being checked WOL will not work. It is unchecked by default .
I guess I will need another line or two in the batch file to be able to remotely check this box. ( Something to do with changing a registry value ?)

Since this is a related to my first question and yet, it complicates the task I am increasing the points .

Thank you.
 
02.21.2007 at 11:00AM PST, ID: 18581021

Rank: Wizard

Have you actually tried if that checkbox needs to be set? As far as I know, this only influences what the machine does when it's in standby mode due to the power settings. A machine that has been shut down/turned off should start (assuming it's enabled in the BIOS) independently of that setting.
It wouldn't help much in the script, anyway. This would have to happen before you run the script, while the machine is running, as you would have to wake the machine in order to change the setting ...
 
02.26.2007 at 10:41AM PST, ID: 18611282
Thank you oBdA for your advice. It looks that this could be the solution I 've been looking for.
As you suggested I found the little tool WOLCMD.exe on the internet and it is doing fine job when I test it with ONE  PC.
When I try to populate my MAClist.txt file with more MAC addresses to test it on multiple PCs I am getting that:

C:\Temp>wolcmd.exe 00188BB4a727
Wake On Lan Command Line...

Usage: wolcmd [mac address] [ipaddress] [subnet mask] [port number]

i.e.  wolcmd 009027a322fc 195.188.159.20 255.255.255.0 7

or    wolcmd 009027a322fc depicus.com 255.255.255.0 7

Copyright www.depicus.com (Brian Slack) 1966-2005

( As per the author of the tool,  WOLCMD.exe does support waking up multiple PCs and can be run as a batch file - an exerpt from the help  :

>>Running WOLCMD from a batch file

>>Simply add multiple entries thus:

>>wolcmd 009027a324fe 195.188.159.20 255.255.255.0 8900
>>wolcmd 009024a731da 212.86.64.31 255.255.255.0 8900


In my MAClist file I tried to use only MAC addresses one at each line , also tried the format WOLCMD suggests:
MAC ADDR             IP ADDRESS        SUBNET MASK     PORT #    - again - one line per each PC. Exa:
00188bb2ad4f     255.255.255.255    255.255.254.0            7


But no luck so far . Any suggestion of whatcould be wrong would be very much appreciated.

thank you
 
02.27.2007 at 01:56AM PST, ID: 18615674

Rank: Wizard

If the exe needs additional parameters, you need to change the for /f command a bit.
So if your Maclist has this format:
<mac> <ip> <subnet> <port>
you need four "tokens" from the file.
The for /f command will take these tokens and store them in the respective environment variables, starting with the one you specify (%%a):

@echo off
:: *** The file with the mac addresses to process:
set MacFile=C:\Temp\maclist.txt
for /f "tokens=1-4" %%a in ('type "%MacFile%"') do ECHO wolcmd.exe %%a %%b %%c %%d

(note that the ECHO is still in there, which will only display the generated commands).
Accepted Solution
 
03.05.2007 at 01:19PM PST, ID: 18657476
Thanks for the excellent advice. Works great with almost all PCs ( two flavors of DElLL - gx 150 and gx 270 do not want to wake up) , do not know what to do , maybe will post another question.

Thanks again
 
 
20080236-EE-VQP-29