vbscript


Create log files with CRT vbs script


I want to run a script that sends some command taking input from an array. For each element of the array I want the print goes to a different log file.
The script I made so far is below but doesn't work. It seems that only stores the print of last command sent.
How would be the correct way to do it please?
#$language = "VBScript"
#$interface = "1.0"
crt.Screen.Synchronous = True
Sub Main
arr = "1,2,3"
a = Split(arr, ",")
For i = LBound(a) To UBound(a)
crt.Session.Log False 'Turn off log session
crt.Session.LogFileName = "C:\Users\Path\MyLogfile No." & a(i) & ".log" 'Define log file name
crt.Session.LogUsingSessionOptions 'Turn on log session
crt.Screen.Send "some command" & a(i) & ";" & Chr(13) 'Some command sent to each arr element, this part works fine
Next
crt.Session.Log False
'Restore the default log file
crt.Session.LogFileName = "C:\Users\myuser\Documents\default.log"
End Sub

Related Links

extract JavaTree Item Color using QTP
Get date format (American or Australian) on a domain controller for Active Directory Script
Print function type mismatch in VBScript
Getting server's CPU usage percentage VBScript
VBS Calculator issues
VBScript To Remove Number from filename
Sparx Enterprise Architect to get the Tagged ┬┤Value from otDiagram VB Script code
Can we code a hold key function in a vb script
Microsoft.Jet.OLEDB.4.0 - Provider cannot be found. It may not be properly installed
Restarting Computer via VBS
Can we number tag items on a window like in speech recognition
saving file with download prompt with vbscript
Object dosen't support this property or method document.getElementById().Value
how to remove value after comma(,) using vbscript and classic asp
vbscript windows xp warning message based on date
VBScript XCopy to local disk not working

Categories

HOME
ms-access
date
c#-4.0
pycharm
comparison
session
webstorm
gis
infragistics
sharepoint-designer
opengl-es-2.0
directx
cross-validation
adfs
basic
n-gram
vb.net-2010
visual-studio-2005
hapi
uitypeeditor
pugjs
code-review
alpine
physics-engine
web-sql
css-animations
wijmo
crosstab
sqlcipher
cas
intel-pin
ejabberd-module
galsim
asset-pipeline
repo
gammu
normal-distribution
picasso
dartium
ws-security
mapzen
elmah
total-commander
node-sass
python-webbrowser
togetherjs
setter
knockout-components
windows-mobile-6.5
r-forge
python-cryptography
sqldf
rotativa
thrust
master-slave
bluegiga
independentsoft
reactive-banana
embedded-code
sframe
dereference
nsmutabledictionary
cdt
socketexception
project-planning
comexception
java.nio.file
centos5
uv-mapping
quantlib-swig
batterylevel
chronoforms
http-unit
android-hardware
free-variable
viewswitcher
enter
pendrive
qt-jambi
imac
floating
xfbml
w3wp.exe
sortable-tables
exchange-server-2003
swing-app-framework
anti-piracy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App