Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-20-2019, 11:46 AM
never2spicy never2spicy is offline
Registered User
 
Join Date: Dec 2019
Posts: 16
Wanting to collect input from crt.Dialog.Prompt to use as a variable for Logfile path

Running the below and i get the prompt and input the number, but doesnt work with path. What do i need to make this work? Desired affect is to prompt the users for an Change control ticket number to create a folder and append to the change file name.

Sub Main
strRFC = crt.Dialog.Prompt(_
"Please specify the change you're working on:", _
"RFC?", _
"")
If strRFC = "" Then Exit Sub
If crt.Session.Logging Then
crt.Session.Log False
End If
crt.Session.LogFileName = "C:\Temp\Logs\%strRFC%\%Y-%M-%D--%h-%m-%s.%t-%S(%H).txt"
crt.Session.LogUsingSessionOptions
crt.Session.Log False
crt.Session.Log True, True
crt.Screen.Send "show run " & chr(124) & " no-more" & chr(13)
End Sub
Reply With Quote
  #2  
Old 12-20-2019, 12:24 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,104
Hi never2spicy,

You are treating the variable as a substitution value. It isn't one.

crt.Session.LogFileName = "C:\Temp\Logs\%strRFC%\%Y-%M-%D--%h-%m-%s.%t-%S(%H).txt"

should be:

crt.Session.LogFileName = "C:\Temp\Logs\" & strRFC & "\%Y-%M-%D--%h-%m-%s.%t-%S(%H).txt"
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 12-20-2019, 01:41 PM
never2spicy never2spicy is offline
Registered User
 
Join Date: Dec 2019
Posts: 16
Very cool, i'll give it a try! thanks!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 09:06 PM.