#1
|
|||
|
|||
![]()
Good morning, I am having an issue where the script argument being passed to SecureCRT has a space in the filepath and is not being fully read. For instance: "C:\Users\someuser\Documents\This Folder\script.js" is being seen as "C:\Users\someuser\Documents\This", and so is saying "The system cannot find the file specified." It is being passed via the script_path var in the following call:
Code:
nResult = objShell.Run( _ Chr(34) & securecrt_path & Chr(34) & " /SCRIPT " & script_path & _ " " & arguments & _ " " & protocol & " /PASSWORD " & Password & _ " " & Username & "@" & host, 5, True) |
#2
|
|||
|
|||
Hi mschaafs,
I'm sorry you're having trouble. Some additional information may help in determining the best solution. When you say "script argument being passed to SecureCRT has a space in the filepath" which variable in the below code is the one you are having trouble with? Where is this variable/argument given its value?
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Reiterate
Hi Eric, thank you for getting back with me, but all that is in the original post. The variable named "script_path" has the script path and it is a local path. When it doesn't have a space in the path, it works perfectly. Is there some special character I need to add in place of the space? Something like '%20' in a url?
|
#4
|
|||
|
|||
Hi mschaafs,
I apologize, I missed that it was the script_path variable. Where and how are you assigning the value to script_path? You may be able to get the behavior you're looking for by ensuring that the "s get sent to the remote system. This can generally be done by using """value""". Please see the example below. Code:
script_path = """C:\Users\someuser\Documents\This Folder\script.js"""
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
Perfecto!
Hello Eric! That did the trick... and in fact, I just wrapped it in Chr(34) to do the same thing. I had actually done that already with the securecrt_path for another reason, so I had the answer all along. :P
Thank you again for your time and hopefully this helps someone else! Code:
nResult = objShell.Run( _ Chr(34) & securecrt_path & Chr(34) & " /SCRIPT " & _ Chr(34) & script_path & Chr(34) & _ " " & arguments & _ " " & protocol & " /PASSWORD " & Password & _ " " & Username & "@" & host, 5, True) |
#6
|
|||
|
|||
Hi mschaafs,
I'm glad to hear you're up and running. Have a great rest of the day.
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Tags |
arguments , failed , path , script , space |
Thread Tools | |
Display Modes | Rate This Thread |
|
|