*.wsf
<JOB ID="openmydoc">
<REFERENCE GUID="{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}"/>
<script language="VBScript">
set WshShell = WScript.CreateObject("Shell.Application")
set oShell = WScript.CreateObject("WScript.Shell")
WshShell.Open(17)
set WshShell = Nothing
set oShell = Nothing
</SCRIPT>
</JOB>
--
Fosco
Are you saying that *.wsf files aren't being recognized as being associated with WSH?
What is the default value of HKCR\.wsf (should be WSFFile). Is there a HKCR\WSFFile branch in the registry? Either of the IE5.5sp1 or WSH 5.6 installs should have created these registry entries...
--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--
>Are you saying that *.wsf files aren't being recognized as being associated with WSH?
YES ( some *.vbs file also)
>What is the default value of HKCR\.wsf (should be WSFFile).
It is a "virgin" installation only IE+OE 5.5 & wsh 5.6 added
it seems regular ( apri stampa ecc is OK it is Italian for open print )
REGEDIT4
[HKEY_CLASSES_ROOT\WSFFile]
@="File di script Windows"
[HKEY_CLASSES_ROOT\WSFFile\DefaultIcon]
@="C:\\WINDOWS\\WScript.exe,2"
[HKEY_CLASSES_ROOT\WSFFile\Shell]
[HKEY_CLASSES_ROOT\WSFFile\Shell\Open]
@="&Apri"
[HKEY_CLASSES_ROOT\WSFFile\Shell\Open\Command]
@="C:\\WINDOWS\\WScript.exe \"%1\" %*"
[HKEY_CLASSES_ROOT\WSFFile\Shell\Open2]
@="A&pri in modalità prompt dei comandi"
[HKEY_CLASSES_ROOT\WSFFile\Shell\Open2\Command]
@="C:\\WINDOWS\\Command\\CScript.exe \"%1\" %*"
[HKEY_CLASSES_ROOT\WSFFile\Shell\Edit]
@="&Modifica"
[HKEY_CLASSES_ROOT\WSFFile\Shell\Edit\Command]
@="C:\\WINDOWS\\Notepad.exe %1"
[HKEY_CLASSES_ROOT\WSFFile\Shell\Print]
@="&Stampa"
[HKEY_CLASSES_ROOT\WSFFile\Shell\Print\Command]
@="C:\\WINDOWS\\Notepad.exe /p %1"
[HKEY_CLASSES_ROOT\WSFFile\ShellEx]
[HKEY_CLASSES_ROOT\WSFFile\ShellEx\PropertySheetHandlers]
[HKEY_CLASSES_ROOT\WSFFile\ShellEx\PropertySheetHandlers\WSHProps]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
[HKEY_CLASSES_ROOT\WSFFile\ShellEx\DropHandler]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
This either doesn't work (*.vbs)
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("C:\windows\notepad")
WScript.Echo oExec.Status
This instead works (*.vbs)
Set Shell = WScript.CreateObject ("Shell.Application")
Shell.Open "c:\programmi"
--
Fosco
If you save the following as hello.wsf, does it run properly when you double-click it from Windows Explorer?
<job>
<script language="vbscript">
MsgBox "hello..."
</script>
</job>
It's not clear to me whether your probalem is that *no* *.wsf files will execute, or that they do execute, but some don't work properly, especially since you are now bringing up issues with *some* *.vbs files...
>Let's deal with one problem at a time...
<job>
<script language="vbscript">
MsgBox "hello..."
</script>
</job>
Thanks Michael this above works.....
>It's not clear to me whether your problem is that *no* *.wsf files will execute,
>or that they do execute, but some don't work properly, especially since
>you are now bringing up >issues with *some* *.vbs files...
It is drive me crazy, some vbs or wsf works some not
Here they that's works :
*.vbs
set WshShell = CreateObject("WScript.Shell")
WshShell.run"c:\windows\notepad.exe"
WScript.Sleep 500
WshShell.SendKeys"Hello"
*.vbs
Set oShell = CreateObject("WScript.Shell")
sProgramFiles = oShell.RegRead _
("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir")
oShell.run(sProgramFiles)
*.vbs
Set Shell = WScript.CreateObject ("Shell.Application")
Shell.ControlPanelItem" Modem.cpl"
*.wsf
<JOB ID="openmydoc">
<REFERENCE GUID="{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}"/>
<script language="VBScript">
set WshShell = WScript.CreateObject("Shell.Application")
WshShell.FileRun
</SCRIPT>
</JOB>
This dont work
*.wsf
<JOB ID="openmydoc">
<REFERENCE GUID="{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}"/>
<script language="VBScript">
set WshShell = WScript.CreateObject("Shell.Application")
WshShell.Open(0)
</SCRIPT>
</JOB>
*.vbs
Set Shell = WScript.CreateObject ("Shell.Application")
Shell.Open "c:\"
( Shell.Open ?????)
Correction from the precedent post this either not works
Set Shell = WScript.CreateObject ("Shell.Application")
Shell.Open "c:\programmi"
'' ( programmi is correct so)
Some file gives error 8007002 or ( i translate in my bad English)
The file is not associated with any Program for the execution ....
It's maybe Active Desktop involved ???
The only difference between here where all works and the new is
VisulBasic 6 here installed ( but i think this is not the matter)
As i said if i take this old registry from this old OS and put it in the new
all works fine
( its real mess for me go trough and compare the two registry)
Sorry for my bad English and thanks for the patience
--
Fosco
The wsf files that use a <reference> element don't error on that element, so the problem isn't related to extracting typelib info. So you probably don't need to look at anything under HKCR\TypeLib\...
If it were me, I'd be looking for something different under the HKCR\Shell.Application branch and the HKCR\CLSID\{...} branch related to it via the HKCR\Shell.Application\CLSID key's default value.
The wsf files that use a <reference> element don't error on that element, so the problem isn't related to extracting typelib info. So you probably don't need to look at anything under HKCR\TypeLib\...
If it were me, I'd be looking for something different under the HKCR\Shell.Application branch and the HKCR\CLSID\{...} branch related to it via the HKCR\Shell.Application\CLSID key's default value.
--
I give up.
I have tried all the possible and the only way it works
is to import an old registry....
Much appreciated your help anyway.
Thanks
--
Fosco