Where is cm_SavePathToFileA?

English support forum

Moderators: white, Hacker, petermad, Stefan2

sexy69
Member
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Where is cm_SavePathToFileA?

Post by *sexy69 »

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)?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

Thank you, it works.
sexy69
Member
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

There is a problem,
It does not read ANSI characters.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

It looks like
"X:\ Transfer\Testy\zam˘w\ľ˘ˆ†.jpg"

I need a script VBS
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

VBS is read
WshShell.Run """X:\ Transfer\Testy\zamów\żółć.jpg"""

and it no longer reads
WshShell.Run """X:\ Transfer\Testy\zam˘w\ľ˘^†.jpg"""
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

Command: wscript.exe
Parameters: "test.vbs" "%P"

And how is it working?

I test.vbs file and click on the icon, nothing happens.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You should read arguments in script. Try this sample script:

Code: Select all

WScript.Echo WScript.Arguments.item(0)
sexy69
Member
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

Code:
WScript.Echo WScript.Arguments.item(0)

And where I'm typing
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

What do you need to type?
sexy69
Member
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

I enter it into the script test.vbs?
sexy69
Member
Member
Posts: 124
Joined: 2016-06-22, 17:21 UTC

Post by *sexy69 »

And as this "WScript.Echo Wscript.Arguments.Item (0)" read anything in VBS or VB6?
Post Reply