Subject: Please help me in WScript.Shell scripting
Posted By: shahhussain Post Date: 8/24/2006 11:04:49 PM
Hello friends I am using the following code :
===============================================
<package>

   <job id="vbs">

      <script language="VBScript">

         set WshShell = WScript.CreateObject("WScript.Shell")

         strDesktop = WshShell.SpecialFolders("Desktop")

         set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")

         oShellLink.TargetPath = WScript.ScriptFullName

         oShellLink.WindowStyle = 1

         oShellLink.Hotkey = "CTRL+SHIFT+F"

         oShellLink.IconLocation = "notepad.exe, 0"

         oShellLink.Description = "Shortcut Script"

         oShellLink.WorkingDirectory = strDesktop

         oShellLink.Save

      </script>

   </job>
==========================================
but it create an Error as :
=======================Error==========
LIne No 7
Char No 10
Error: Object Required "WScript"
Code 0
======================================
I have copy and paste this code form microsoft website and save this code with .asp extention.
Please any body hlep me that what object I need to install to run this script and from where can i find that object or software.
Thanks you all in advance.



Shahhussain
Reply By: dparsons Reply Date: 8/25/2006 7:38:51 AM
Its not an asp script, its a WSH script and needs to be saved with a .vbs extension.  That lanague VBScript does not make a script an ASP page, its the methods, functions, and procedure calls you make within a page that define it as such.

What you are doing above is designed to be executed on a local pc, not executed on a web browser.

"The one language all programmers understand is profanity."
Reply By: shahhussain Reply Date: 10/3/2006 3:05:42 PM
thanks to reply to my question.
I want to use this script in my web site,through any user can open
Notepad and can write as user can use his/her own OS notepad.

Shahhussain
Reply By: dparsons Reply Date: 10/3/2006 3:11:27 PM
You are gong to need to use a COM component to embed an application in that case;  simple fact of the matter is, when you execute the above script via a website, it does not trigger anything on the client machine and it never will (unless the user downloads the script and executes it themselves on their pc)

--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.

Go to topic 50551

Return to index page 158
Return to index page 157
Return to index page 156
Return to index page 155
Return to index page 154
Return to index page 153
Return to index page 152
Return to index page 151
Return to index page 150
Return to index page 149