Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Why wont my application launch?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,49362
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Why wont my application launch?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Why wont my application launch? - 7/11/2007 11:31:26 AM   
  chrisgoforth

 

Posts: 8
Score: 0
Joined: 7/6/2007
Status: offline
Okay again this is probably something simple for all of you but not for little ol me. You guys have been a very big help so far and it is very much appreciated. I think I am using the wrong commands (is the right term?) in here but I am not really sure what I should be using. Basically the setup is I have a card swipe (magnetic card reader) that customers will walk up to a kiosk and swipe their card via the card reader and the card reader then sends that data into a program called simple swipe that sends it off to a sql database. I had to devise this script to remove some data and add other data from the swipe. That is all working great. Now all I have left is to have it send that data into the simple swipe program. The program only has 1 dialog box that can have data put into. The problem is the script is not feeding into the program. I need the script to see the program if it is up and feed the information into it or launch the program if it is not up. Any ideas?

Here is the script.

Option Explicit

DIM strTitle 'Input box title
DIM strPrompt ' Prompt for input box
DIM strDefault 'Default value for input box
DIM strSwipe 'swipe data
DIM OutputFile  'The Output File C:\MagTekFile.txt
DIM Filesystem
DIM objFSO
DIM objFile
DIM strSubSwipe 'The shortened Card #
DIM strSiteID 'First 2 #'s of the card after it is shortened  ie 39
DIM strResult 'Resulting data after extra is removed & zero added
Dim SimpleSwipe 'Simpleswipe program
Dim MPSS 'MPSS

Const ForAppending = 8

'InputBox Data

strTitle = "Total Rewards Card Swipe"
strPrompt = "Swipe Card Now"
strDefault = "Good Luck"
OutputFile = "C:\MagTekFile.txt"  'Assigning the Path to OutPutFile variable The txt file was for testing
SimpleSwipe = "c:\program files\mps\SimpleSwipe\SimpleSwipeOnline.exe" 'Simple Swipe Path
MPSS = "c:\program files\mps\SimpleSwipe\SimpleSwipeOnline.exe"

'This grabs the data that was swiped and strips it to the desired section of #'s and calls Function Location
'Also get the first 2 #'s of card SiteID and sends to Function Location

Do While True
strSwipe = InputBox(strPrompt,strTitle,strDefault)
If strSwipe = "" Then
  WScript.Quit
End If
strSubSwipe = Ucase(Mid(strSwipe,17,9))
strSiteID  = Ucase(Mid(strSubSwipe,1,2))

'The call of the function that adds the missing zero with formula
Call Location(strSubSwipe, strSiteID)
Set SimpleSwipe = GetObject("c:\program files\mps\SimpleSwipe\SimpleSwipeOnline.exe") '("mpss"))
If objFSO.FileExists(SimpleSwipe) Then
   Set SimpleSwipe = GetObject("c:\program files\mps\SimpleSwipe\SimpleSwipeOnline.exe")'("mpss"))
   objFile.WriteLine strResult
Else
   Set SimpleSwipe = GetObject("c:\program files\mps\SimpleSwipe\SimpleSwipeOnline.exe")
   objFile.writeline strResult
End If

'***Loop setting***
objFile.Close
Loop

'Add missing zero depending on Property
Function Location(strSubSwipe, strSiteID)
DIM dblSubSwipe
Const dblFraction = .000001
IF strSiteID = "39" Then
dblSubSwipe = CDbl(strSubSwipe)
dblSubSwipe = dblSubSwipe * dblFraction
dblSubSwipe = dblSubSwipe + 3510
dblSubSwipe = dblSubSwipe / dblFraction
strResult = CStr(dblSubSwipe)

ElseIf strSiteID = "80" Then
dblSubSwipe = CDbl(strSubSwipe)
dblSubSwipe = dblSubSwipe * dblFraction
dblSubSwipe = dblSubSwipe + 7200
dblSubSwipe = dblSubSwipe / dblFraction
strResult = CStr(dblSubSwipe)

Else
END If
End Function




_____________________________

I am very new to VBS and need lots and lots and lots of help
 
 
Post #: 1
 
 RE: Why wont my application launch? - 7/11/2007 11:02:12 PM   
  mbouchard


Posts: 1924
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
To see if the program is running, check for the process, here is an example from the Script Center


      

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to chrisgoforth)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Why wont my application launch? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts