English support forum
Moderators: white , Hacker , petermad , Stefan2
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-16, 08:14 UTC
There are commands:
cm_SaveSelectionToFileA
cm_SaveDetailsToFileA
and
cm_AddPathToCmdline
I would want to save the path to the txt file
"SavePathToFileA"
How to do this without Clip (cm_CopySrcPathToClip)?
MVV
Power Member
Posts: 8702 Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation
Post
by *MVV » 2016-08-16, 08:24 UTC
If you need just current path, you can use a button as simple as this one:
Code: Select all
Command: cmd.exe
Parameters: /c "echo %P > "file.txt""
(you can replace
file.txt with full path to file)
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-16, 09:54 UTC
Thank you, it works.
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-17, 07:42 UTC
There is a problem,
It does not read ANSI characters.
MVV
Power Member
Posts: 8702 Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation
Post
by *MVV » 2016-08-17, 09:21 UTC
Console apps use OEM encoding by default, just try to open file with proper encoding. Are you really need ANSI text file and not Unicode one? What do you do with it next?
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-17, 09:36 UTC
It looks like
"X:\ Transfer\Testy\zam˘w\ľ˘ˆ†.jpg"
I need a script VBS
MVV
Power Member
Posts: 8702 Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation
Post
by *MVV » 2016-08-17, 09:43 UTC
If you then run a script, you can pass path to script itself, or you can save Unicode file and read it from script, it shouldn't be hard.
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-17, 09:56 UTC
VBS is read
WshShell.Run """X:\ Transfer\Testy\zamów\żółć.jpg"""
and it no longer reads
WshShell.Run """X:\ Transfer\Testy\zam˘w\ľ˘^†.jpg"""
MVV
Power Member
Posts: 8702 Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation
Post
by *MVV » 2016-08-17, 10:13 UTC
Can't you directly run your script with path argument and
access passed arguments ?
Code: Select all
Command: wscript.exe
Parameters: "script.vbs" "%P"
And,
FSO.OpenTextFile supports Unicode files so you can export path in Unicode by adding
/u parameter to cmd.exe command line.
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-17, 10:45 UTC
Command: wscript.exe
Parameters: "test.vbs" "%P"
And how is it working?
I test.vbs file and click on the icon, nothing happens.
MVV
Power Member
Posts: 8702 Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation
Post
by *MVV » 2016-08-17, 12:47 UTC
You should read arguments in script. Try this sample script:
Code: Select all
WScript.Echo WScript.Arguments.item(0)
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-17, 12:55 UTC
Code:
WScript.Echo WScript.Arguments.item(0)
And where I'm typing
MVV
Power Member
Posts: 8702 Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation
Post
by *MVV » 2016-08-17, 13:44 UTC
What do you need to type?
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-17, 13:47 UTC
I enter it into the script test.vbs?
sexy69
Member
Posts: 124 Joined: 2016-06-22, 17:21 UTC
Post
by *sexy69 » 2016-08-17, 14:06 UTC
And as this "WScript.Echo Wscript.Arguments.Item (0)" read anything in VBS or VB6?