Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 24th, 2006, 11:04 PM
Authorized User
 
Join Date: Dec 2005
Location: Mingora, NWFP, Pakistan.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shahhussain Send a message via Yahoo to shahhussain
Default Please help me in WScript.Shell scripting

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
__________________
Shahhussain
  #2 (permalink)  
Old August 25th, 2006, 07:38 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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."
  #3 (permalink)  
Old October 3rd, 2006, 03:05 PM
Authorized User
 
Join Date: Dec 2005
Location: Mingora, NWFP, Pakistan.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shahhussain Send a message via Yahoo to shahhussain
Default

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
  #4 (permalink)  
Old October 3rd, 2006, 03:11 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with WScript.Shell object ninja_kornjaca Classic ASP Components 6 June 9th, 2008 01:35 AM
wscript pull data only by current date putermikey Classic ASP Professional 1 October 31st, 2006 06:49 AM
Error in WScript.CreateObject pankaj.talk Pro VB.NET 2002/2003 1 June 5th, 2006 03:34 PM
WScript RTC Classic ASP Basics 2 June 8th, 2005 04:03 AM
Wscript Permissions Problem orph351 Classic ASP Components 0 September 4th, 2003 03:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.