Welcome to the Calyx Software Message Boards where you can share ideas and solutions with other Calyx users! Calyx personnel including Tech Support, Development, QA, and Business Planning often visit these message boards unofficially to better understand our customers' needs. To submit your suggestions Click Here.
This discussion forum is a service provided by Calyx Software. Calyx Software does not endorse any particular point of view expressed in this forum or any information provided in it. The use of the information provided by other users in this message board is at your own risk.
Calyx Software Message Board
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


««12

Can I copy the Import.exe to a separate...Expand / Collapse
Author
Message
Posted 8/16/2005 10:10:07 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/21/2007 3:27:09 PM
Posts: 95, Visits: 748
I have not, but I will double-check.  The problem is the program works fine when I double click.  When I try to execute from command-line, it doesn't.
Post #189
Posted 8/16/2005 10:22:30 AM


Supreme Being

Supreme Being

Group: Moderators
Last Login: 12/21/2008 11:16:31 PM
Posts: 837, Visits: 1,901
So simply passing the IMPORT.EXE parameters from a comand line does not work?  Can you please post a reply with your full command line?

Bryan
Point Product Manager
Post #190
Posted 8/16/2005 10:38:52 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/21/2007 3:27:09 PM
Posts: 95, Visits: 748
Finally, its working.  I think it was due to three things.

1.  I had a relative path for the import.exe file and ImportDefinition.  Absolute paths are a must.

2.  Wscript.Echo - I was trying to debug and view the command about to be executed.  When I double click, a pop-up box appears.  From command line, no pop-up box visible, but the program is still waiting for input.  I commented out the debugging code.

3.  Way too many open windows.

Am I violating anything by posting my code?

Post #191
Posted 8/16/2005 4:00:27 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/21/2007 3:27:09 PM
Posts: 95, Visits: 748
==== ImportFiles.vbs ==========

Option Explicit
On Error Resume Next


Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const ImportDefinition  = "D:\ScheduledTasks\WebAppImport\Final.imp" 'Import Definition Created in Point
Const ImportLocation = "J:\PROSPECT" ' Prospect Area
Const ImportFile = "D:\ScheduledTasks\WebAppImport\ImportCode\Import.exe" ' ImportCode contains all dependent DLLs

Dim oFiles, FileName, return
Dim WshShell, WSHNetwork
Dim fso, f, fc, fsoWriteFile, ImportCommand

Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set WSHNetwork = WScript.CreateObject("WScript.Network")


WSHNetwork.RemoveNetworkDrive "J:", True, True
WSHNetwork.RemoveNetworkDrive "K:", True, True

WSHNetwork.MapNetworkDrive "J:", "\\server\destinationShare"
WSHNetwork.MapNetworkDrive "K:", "\\server\SourceShare"

set f = fso.GetFolder("K:\")
set fc = f.Files

' Open Log file for appending results
set fsoWriteFile = fso.OpenTextFile("k:\WebImportLog.log",ForAppending, true)

'Parse files in target directory
for each FileName in fc
 if instr(3,Filename, "app",1) then 'app prefix will appear on all web originated files
   ImportCommand = ImportFile & " " & FileName & " " &_
      ImportDefinition & " " & ImportLocation
   fsoWriteFile.WriteLine "======================================================" _&
         "     =================================="
   fsoWriteFile.WriteLine ( "-- " & FileName & " == Read " & Date & " @ " & Time & " ---" )
   fsoWriteFile.WriteLine ImportCommand
   
   'The Beef   
   return = WshShell.Run(ImportCommand,1,true)
   
   fsoWriteFile.WriteLine( "---- Processed with Exit Code = " & return)
   fsoWriteFile.WriteLine ("---- " & FileName & " Moved to Archive Folder")
   fso.MoveFile FileName, "K:\Archive\"
   fsoWriteFile.WriteLine "=======================================================" _&
               "================================="
   fsoWriteFile.WriteLine
 else
 end if
Next


'Remove Network Drives
WSHNetwork.RemoveNetworkDrive "J:", True, True
WSHNetwork.RemoveNetworkDrive "K:", True, True


'Cleanup
fsoWriteFile.Close
Set WSHNetwork   = nothing
Set fsoWriteFile  = nothing
Set fso    = nothing
========================

Post #196
Posted 8/19/2005 12:22:45 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/13/2006 5:31:37 PM
Posts: 9, Visits: 49
Orion,
If you ever anticipate file names with spaces in them, you should wrap quotes around your command line arguments.

USE: the Chr(34) literal quote
ImportCommand = ImportFile & " " & Chr(34) & FileName & Chr(34) & " " &_
      Chr(34) & ImportDefinition & Chr(34) & " " & Chr(34)  & ImportLocation & Chr(34)
Post #250
« Prev Topic | Next Topic »

««12

Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Emmanuel Huna, Bryan Telford, Jason Beck, Mike Thompson, BetaFisch

PermissionsExpand / Collapse

All times are GMT -8:00, Time now is 9:15pm

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.063. 13 queries. Compression Enabled.
© 2005 Calyx Software. All rights reserved.