[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to use the WScript.Shell?

Posted on 2001-07-26
2
Medium Priority
?
3,212 Views
Last Modified: 2007-12-19
<%
  set oShell = Server.CreateObject ("WScript.Shell")
  cmd = "%COMSPEC% /c xcopy c:\test.txt d:\dellsftw\kevin"
  oShell.run cmd, 0, true
  oShell.close
%>

Above is the script I used to copy a file called test.txt from C:\ to D:\Dellsftw\Kevin.

During the first time I run this script I found it ok but I tried it for the second and third time, my Internet explorer keep on saying opening page, it seems like never ending. Why like this?

Where can I find the documentation for WScript object's information like what is the methods and properties inside, so that I know how to use it in the future.

Thanks for your help.
0
Comment
Question by:calven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
DirkVe earned 160 total points
ID: 6321239
There's a small mistake in the copy statement, and therefore it doesn't work (even not the first time, but after th first time it keeps running and that's why the second time there's no response).

If it's correct that kevin is a directory, change this line

cmd = "%COMSPEC% /c xcopy c:\test.txt d:\dellsftw\kevin"
 
TO

cmd = "%COMSPEC% /c xcopy c:\test.txt d:\dellsftw\kevin\"

(extra \  after kevin).


Also, replace the close statement (this method doesn't exist):
replace oShell.close
with set oShell = Nothing

NOTE: Before you start testing this, close the browser and test in a new one, since you still have a process running.

Good luck.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6905130
This question has been finalized by an experts-exchange Moderator.  If you have any questions in this regard, please let me know and I'll return when I can.  The closing recommendations were posted in Community Support here:
http://www.experts-exchange.com/questions/Q.20282861.html

In the event Asker returns with additional needs regarding this question, please respond.

Thanks,
Moondancer - EE Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question