Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 2nd, 2007, 06:54 AM
bob_man_uk bob_man_uk is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 59 bob_man_uk User rank is Sergeant (500 - 2000 Reputation Level)bob_man_uk User rank is Sergeant (500 - 2000 Reputation Level)bob_man_uk User rank is Sergeant (500 - 2000 Reputation Level)bob_man_uk User rank is Sergeant (500 - 2000 Reputation Level)bob_man_uk User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 822415 Folding Title: Super Ultimate Folder - Level 2Folding Points: 822415 Folding Title: Super Ultimate Folder - Level 2Folding Points: 822415 Folding Title: Super Ultimate Folder - Level 2Folding Points: 822415 Folding Title: Super Ultimate Folder - Level 2Folding Points: 822415 Folding Title: Super Ultimate Folder - Level 2Folding Points: 822415 Folding Title: Super Ultimate Folder - Level 2Folding Points: 822415 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 13 h 13 m 23 sec
Reputation Power: 10
WSH and reading a line from a file that matches a string

hi all,

im kind of stuck and need pointing in the right direction (or left, whichever gets the job done )

ok so i have this simple script already

Code:
Dim WSHShell
Dim Message
Dim Title

Message = "Please Enter the drawing number and path  --  IE. \\phidias\loosegears"
Title = "DrawPrint - 2007"
Text1 = "Canceled"

Set WSHShell = WScript.CreateObject("WScript.Shell")

result = InputBox(Message,Title,"")
If result = "" Then
WScript.Echo Text1
Else 
WshShell.Run """C:\progra~1\Solide~1\Program\smartvw.exe""" + result
WScript.Sleep(3000)
WshShell.SendKeys "^p"
WScript.Sleep(2000)
WshShell.SendKeys "%p"
WScript.Sleep(2000)
WshShell.SendKeys "%l"
WScript.Sleep(2000)
WshShell.SendKeys "{ENTER}"
WScript.Sleep(2000)
WshShell.SendKeys "{ENTER}"
WScript.Sleep(2000)
WshShell.SendKeys "%{f4}"
End If
WScript.Quit()


basically asks the user for input... but im trying to make it a little bit more automated (or easier) for the user.

we have a file for our drawing printing program that contains every drawing available in a certain directory

small example

Quote:
\\hermes\TU\1234.dwg
\\hermes\TI\5678.edwg
\\hermes\RU\13579.dft


I want to search this file for a particular drawing number "13579" for the sake of an example and have the entire line "\\hermes\RU\13579.dft" returned in the script which can then be passed onto the program so it can follow the rest of the program and print the drawing.

does anyone know where i should start looking or if i could eliminate the need to send key presses that can easily be interupted (not that the key presses need to be changed, it will be running on a server console thats hidden away from user interaction).

thanks in advance.

Matty G

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > WSH and reading a line from a file that matches a string


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway