Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-24-2013, 10:53 PM   #1
Baseband Member
 
palermo's Avatar
 
Join Date: Jan 2013
Location: United States
Posts: 81
Default Windows Batch Scripting: I'm Stuck!?

Tonight's homework is out of control. I can't even do the first problem. When I run the batch file it says (FIND: parameter format not correct).

What is the output of the following batch file:

dir /s/p c:\*.vbs | find ping

I understand that dir /s/p is a listing of whatever directory with all files in a page by page format. It seems like it is searching the c:\ for any .vbs files or (|) find ping. I am lost
__________________

palermo is offline   Reply With Quote
Old 05-25-2013, 02:27 AM   #2
Fully Optimized
 
strollin's Avatar
 
Join Date: Mar 2011
Location: USA
Posts: 1,940
Default Re: Windows Batch Scripting: I'm Stuck!?

The | is known as a pipe and is used to direct the output of one command to the input of another. I believe the command should actually be dir /s/p c:\*.vbs | find "ping". Used this way, the output of the dir command would be searched using the find command and only lines containing the string "ping" would be listed in the output.
__________________

strollin is offline   Reply With Quote
Old 05-25-2013, 12:18 PM   #3
Baseband Member
 
palermo's Avatar
 
Join Date: Jan 2013
Location: United States
Posts: 81
Default Re: Windows Batch Scripting: I'm Stuck!?

strollin, it worked. I appreciate it. The simplest syntax gets me every time, especially with UNIX scripting since there comparison operators are opposite of Perl and I think everyone else.
palermo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:12 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0