Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-28-2021, 08:22 AM
stefanh stefanh is offline
Registered User
 
Join Date: May 2021
Posts: 3
Error in Cisco Save Running/Startup Config to Local File - line 301

Tried using this script, to save running config.

https://forums.vandyke.com/showthread.php?p=35881

But i get an error in line 301.

Any ideas? I speak network, not python

Stefan
Reply With Quote
  #2  
Old 05-28-2021, 09:08 AM
cboyack cboyack is offline
VanDyke Technical Support
 
Join Date: Apr 2020
Location: Albuquerque, NM
Posts: 132
Hi stefanh,

What is the *exact* error that you're seeing?

If you want to post an image of it instead of writing it out, please see this post.

Also:
What version of SecureCRT are you using?

What is the OS upon which you're running SecureCRT?
__________________
Thanks,
--Cameron

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 05-28-2021, 01:43 PM
stefanh stefanh is offline
Registered User
 
Join Date: May 2021
Posts: 3
Yeah I wish I could attach a file, but no "Attach Files" option under "Additional Options". Btw, its 2021, it could be a lot easier to attach screenshots

UnicoreEncodeError

Error: ascii
File: C:\users\blank\Documents\Cisco-SaveDeviceConfigToFile.py
Line: 301


LogLine("Session Path:{}".format(g_strSessionPath))


Windows server 2019 standard
SecureCRT 9.0.0 x64 build 2430
Reply With Quote
  #4  
Old 05-28-2021, 03:04 PM
cboyack cboyack is offline
VanDyke Technical Support
 
Join Date: Apr 2020
Location: Albuquerque, NM
Posts: 132
I'd like you to make a modification to the script so that we can get a better idea as to the error that you're seeing. Please modify the script thusly:

From:

Code:
    LogLine("Session Name: {}".format(g_strSessionName))
    if g_strSessionName <> g_strSessionPath:
        LogLine("Session Path: {}".format(g_strSessionPath))
To:

Code:
    LogLine("Session Name: {}".format(g_strSessionName))
    crt.Dialog.MessageBox(g_strSessionPath)
    #if g_strSessionName != g_strSessionPath:
    #    LogLine("Session Path: {}".format(g_strSessionPath))
...and run the script again. Once you've run the script after the edit, what text is shared in the MessageBox?
__________________
Thanks,
--Cameron

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 06-11-2021, 12:33 PM
stefanh stefanh is offline
Registered User
 
Join Date: May 2021
Posts: 3
When trying your new code, and reproducing the error, it works for some reason both with the "new" code, and the old.

Not sure what was done differently this time, its been two weeks since I last tried. All i can think of is some sort of path issue.
Reply With Quote
Reply

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 04:30 PM.