Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - drag and drop - registry entry

Reply
 
Old 07-24-2009   #1 (permalink)
Reventlov


 
 

drag and drop - registry entry

Could you please tell me what's the correct value for this registry entry?

HKEY_CURRENT_USER\Software\Classes\Applications\wscript.exe\shell\open\command

I have
"C:\WINDOWS\system32\wscript.exe" "%1" "%*"

But it must be wrong because if I drop the file "this is a test.txt" on a vbs I have
objArgs(0) equal to -this-

I set this value of the registry when I had troubles after installation of sp3.

I'm writing a script to create an htm from a txt. I need it to read txt's on my phone
which supports only images and htm's.

Thanks a lot.
Giovanni



--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--

My System SpecsSystem Spec
Old 07-24-2009   #2 (permalink)
mayayana


 
 

Re: drag and drop - registry entry

I have no such key under HKCU or under
HKCR/HKLM. But I do have
HKCR\vbsFile\Shell\Open\Command\

What I see there is:

C:\WINDOWS\WScript.exe "%1" %*

(It's all in quotes as viewed in Regedit, but
the actual string is as above.)

Quote:

> Could you please tell me what's the correct value for this registry entry?
>
>
HKEY_CURRENT_USER\Software\Classes\Applications\wscript.exe\shell\open\comma
nd
Quote:

>
> I have
> "C:\WINDOWS\system32\wscript.exe" "%1" "%*"
>
> But it must be wrong because if I drop the file "this is a test.txt" on a
vbs I have
Quote:

> objArgs(0) equal to -this-
>
> I set this value of the registry when I had troubles after installation
of sp3.
Quote:

>
> I'm writing a script to create an htm from a txt. I need it to read txt's
on my phone
Quote:

> which supports only images and htm's.
>
> Thanks a lot.
> Giovanni
>
>
>
> --
> Giovanni Cenati (Bergamo, Italy)
> Write to "Reventlov" at katamail com
> http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
> --

My System SpecsSystem Spec
Old 07-24-2009   #3 (permalink)
Reventlov


 
 

Re: drag and drop - registry entry

Il giorno Fri, 24 Jul 2009 15:00:42 -0400, "mayayana" <mayaXXyana@xxxxxx> ha scritto:
Quote:

>I have no such key under HKCU or under
>HKCR/HKLM. But I do have
>HKCR\vbsFile\Shell\Open\Command\
>
>What I see there is:
>
>C:\WINDOWS\WScript.exe "%1" %*
>
>(It's all in quotes as viewed in Regedit, but
>the actual string is as above.)
Thank you very much for your quick answer.

In that key I have (with no quotes)
%SystemRoot%\System32\CScript.exe "%1" %*

Which does not have any sense, as I have Wscript as default engine, not Cscript.
Anyway, I stripped off the quotes from %*. I guess I have to restart now to see if it
works. I'll tell you after the weekend. I fixed it in some other entries.
So far it worked because I only used to rename picture files taken from the camera, whose
files have no blanks in the names.
Only today I found this problem. My txt2html script works only with filenames with no
blanks.
Giovanni

--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
My System SpecsSystem Spec
Old 07-24-2009   #4 (permalink)
Tom Lavedas


 
 

Re: drag and drop - registry entry

On Jul 24, 2:29*pm, no...@xxxxxx (Reventlov) wrote:
Quote:

> Could you please tell me what's the correct value for this registry entry?
>
> HKEY_CURRENT_USER\Software\Classes\Applications\wscript.exe\shell\open\command
>
> I have
> "C:\WINDOWS\system32\wscript.exe" "%1" "%*"
>
> But it must be wrong because if I drop the file "this is a test.txt" on avbs I have
> objArgs(0) equal to -this-
>
> I set this value of the registry *when I had troubles after installation of sp3.
>
> I'm writing a script to create an htm from a txt. I need it to read txt'son my phone
> which supports only images and htm's.
>
> Thanks a lot.
> Giovanni
>
> --
> Giovanni Cenati (Bergamo, Italy)
> Write to "Reventlov" at katamail comhttp://digilander.libero.it/Cenati(Esempi e programmi in VbScript)
> --
I'm not certain what your problem is, but simply changing the
extension to .htm might be sufficient to make the file display in many
web browsers. The main problem with this approach would be that all
new line marks would be ignored, but on a phone screen this might not
be unacceptable.

Tom Lavedas
***********
My System SpecsSystem Spec
Old 07-24-2009   #5 (permalink)
Reventlov


 
 

Re: drag and drop - registry entry

Il giorno Fri, 24 Jul 2009 15:00:42 -0400, "mayayana" <mayaXXyana@xxxxxx> ha scritto:
Quote:

>I have no such key under HKCU or under
>HKCR/HKLM. But I do have
>HKCR\vbsFile\Shell\Open\Command\
>
>What I see there is:
>
>C:\WINDOWS\WScript.exe "%1" %*
>
>(It's all in quotes as viewed in Regedit, but
>the actual string is as above.)
Thank you very much,
it works now.

Now I can save short stories from sf groups in txt format and easily change them to html
texts. I put them on the phone and read something in waiting rooms when I cannot watch my
favourite mp4 spiderman cartoons.

Giovanni
----------------------------------------------------
'Txt2Html
'Trasforma un txt in un testo html
'Cenati Giovanni
'Http://digilander.libero.it/Cenati
'24/7/2009
Const ForReading = 1 'Open a file for reading only. You can't write to this file
Const ForWriting = 2 'Open a file for writing

Titolo="txt to html"
Set objArgs = WScript.Arguments

if objargs.count=0 then
MsgBox "Drop a txt file on the icon",vbinformation+vbokonly,Titolo
wscript.quit
end if

NomeTxt=objArgs(0)
Content=File_ReadEntireFile(NomeTxt)
Content=Replace(Content,"<","&lt;")
Content=Replace(Content,vbCrLf,"<br>")
Content="<html><title>"&NomeTxt&"</title><body>"&Content&"</body></html>"
Ok=File_WriteLine( NomeTxt & ".htm", Content )
If ok<>True Then MsgBox "Cannot save",,Titolo
WScript.Quit

'------------------------------------------------------------------------
' string File_ReadEntireFile( sFileName )
'------------------------------------------------------------------------
' Legge l'intero Contenuto del file
' Ritorna il testo letto
'------------------------------------------------------------------------
Function File_ReadEntireFile( ByVal sFileName )
Dim opfs, fp, retstring

On Error Resume Next
File_ReadEntireFile = ""

Set opfs = CreateObject("Scripting.FileSystemObject")
if Err <> 0 then
Exit Function
end if

Set fp = opfs.OpenTextFile( sFileName, ForReading, False )
if Err <> 0 then
set opfs = nothing
Exit Function
end if

retstring = fp.Readall

fp.Close

set opfs = nothing

File_ReadEntireFile = retstring
Err.Clear
On Error Goto 0

End Function


'------------------------------------------------------------------------
' Bool File_WriteLine( sFileName, sData )
'------------------------------------------------------------------------
' Crea il file sFileName ed aggiunge al file una riga
' Attenzione. Se il file esiste, lo ricrea
' Torna True se tutto ok
'------------------------------------------------------------------------
Function File_WriteLine( ByVal sFileName, ByVal sData )
Dim opfs, fp

On Error Resume Next
File_WriteLine=False

Set opfs = CreateObject("Scripting.FileSystemObject")
if Err <> 0 then
Exit Function
end if

Set fp = opfs.OpenTextFile( sFileName, ForWriting, true )
if Err <> 0 then
set opfs = nothing
Exit Function
end if

fp.WriteLine sData
if Err <> 0 then
set opfs = nothing
Exit Function
end if

fp.Close

File_WriteLine=True
set opfs = nothing
Err.Clear
On Error Goto 0

End Function



--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
My System SpecsSystem Spec
Old 07-24-2009   #6 (permalink)
Reventlov


 
 

Re: drag and drop - registry entry

Il giorno Fri, 24 Jul 2009 13:03:35 -0700 (PDT), Tom Lavedas <tglbatch@xxxxxx> ha
scritto:
Quote:

>I'm not certain what your problem is, but simply changing the
>extension to .htm might be sufficient to make the file display in many
>web browsers. The main problem with this approach would be that all
>new line marks would be ignored, but on a phone screen this might not
>be unacceptable.
In the stories i save from sf groups, sometimes dialogs start with <
and this is interpreted as the beginning of a html tag.
The first stories I read on the phone seemed have no sense because some dialogs were
missing. I only changed the extension as you suggest.
So the script changes < with %lt; and vbcrlf with <br>
I posted the script.
Thank you.
Giovanni.

--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
My System SpecsSystem Spec
Old 07-24-2009   #7 (permalink)
mayayana


 
 

Re: drag and drop - registry entry

> Now I can save short stories from sf groups in txt format and easily
change them to html
Quote:

> texts. I put them on the phone and read something in waiting rooms when I
cannot watch my
Quote:

> favourite mp4 spiderman cartoons.
I'm glad you're not stuck watching game shows
on the waiting room TV.

I'm still wondering about that Applications key,
though. I have a few entries under my HKLM\HKCR
version of that key, but I've never noticed it before.
And I can't seem to find anything online that
explains what those entries are for. I wonder if the
string in that key will override the file extension
key. In other words, if I had the following:

HKCR\Applications\notepad.exe\shell\open\command\

HKCR\.txt default value: "txtfile"

HKCR\txtfile\shell\open\command\
default value: notepad.exe...

then which key takes precedence?

I just tried opening a txt file with regmon running
and don't see any sign that the Applications key was
accessed.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
drag and drop Vista General
Drag and Drop Live Mail
No Drag and Drop? Vista mail
Access denied trying to "md"? Drag & Drop is now drag, drop, OK, OK ???? Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46