Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > de.comp.lang.javascript > #5236

Re: Fehler bei Ausführung js-Code im WSH

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups de.comp.lang.javascript
Subject Re: Fehler bei Ausführung js-Code im WSH
Date 2021-01-29 21:25 +0100
Organization PointedEars Software (PES)
Message-ID <3347640.iIbC2pHGDl@PointedEars.de> (permalink)
References <i7j46kF7en1U1@mid.individual.net>

Show all headers | View raw


Louis Noser wrote:

> Was ist im folgenden Java-Script-Code falsch?

Es ist weder Java-Script, noch JavaScript oder sonst irgendein ECMAScript-
konformer Code.  Folglich ist er für eine ECMAScript-konforme Script-Engine 
schlicht syntaktisch falsch und kann nicht compiliert (und auch nicht 
ausgeführt) werden.
 
> Set wshshell = WScript.CreateObject ("wscript.shell")
> wshshell.run "c:\Windows\system32\cmd.exe", 6, True
> set wshshell = nothing

In Microsoft JScript sähe das so aus (ungetestet):

  var wshshell = WScript.CreateObject("WScript.Shell");
  wshshell.Run("C:\\Windows\\system32\\cmd.exe", 6, True);
  wshshell = null;

Die letzte Zeile ist aber überflüssig.

<https://docs.microsoft.com/en-us/windows/win32/com/scripting-with-com-objects>

Mir scheint aber, dass es (neu)

  var wshshell = WScript.CreateObject("Shell.Application");
  wshshell.ShellExecute("cmd.exe", "", "", "open", 1);

heissen muss, siehe

<https://docs.microsoft.com/en-us/windows/win32/shell/shell-shellexecute>

(Das war extrem schwierig zu finden.)
 
> Quelle: https://www.script-example.com/themen/run_external_in_vbscript.php

*VB*Script ist *hier* *offensichtlich* off-topic.
 
> Fehlermeldung:
> https://workupload.com/file/pBbeCcy8DWy

Hier ist nicht das Web.  Kopier Fehlermeldungen bitte (zusätzlich) als Text 
in Deine Postings.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to de.comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Fehler bei Ausführung js-Code im WSH Louis Noser <louis.noser.wegwerf@gmail.com> - 2021-01-29 19:58 +0100
  Re: Fehler bei Ausführung js-Code im WSH Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-01-29 21:25 +0100
    Re: Fehler bei Ausführung js-Code im WSH Louis Noser <louis.noser.wegwerf@gmail.com> - 2021-01-30 09:50 +0100
      Re: Fehler bei Ausführung js-Code im WSH Stefan Reuther <stefan.news@arcor.de> - 2021-01-30 11:11 +0100
        Re: Fehler bei Ausführung js-Code im WSH Louis Noser <louis.noser.wegwerf@gmail.com> - 2021-01-30 11:48 +0100
          Re: Fehler bei Ausführung js-Code im WSH Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-01-30 15:48 +0100
            Re: Fehler bei Ausführung js-Code im WSH Louis Noser <louis.noser.wegwerf@gmail.com> - 2021-01-31 17:37 +0100
              Re: Fehler bei Ausführung js-Code im WSH Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-02-02 20:26 +0100
        Re: Fehler bei Ausführung js-Code im WSH Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-01-30 15:45 +0100
        Re: Fehler bei Ausführung js-Code im WSH Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-01-30 16:03 +0100
      Re: Fehler bei Ausführung js-Code im WSH Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-01-30 15:44 +0100
      Re: Fehler bei Ausführung js-Code im WSH Arno Welzel <usenet@arnowelzel.de> - 2021-01-31 14:08 +0100
        Re: Fehler bei Ausführung js-Code im WSH Louis Noser <louis.noser.wegwerf@gmail.com> - 2021-01-31 17:41 +0100
          Re: Fehler bei Ausführung js-Code im WSH Louis Noser <louis.noser.wegwerf@gmail.com> - 2021-01-31 20:06 +0100
            Re: Fehler bei Ausführung js-Code im WSH Arno Welzel <usenet@arnowelzel.de> - 2021-02-01 14:49 +0100
  Re: Fehler bei Ausführung js-Code im WSH Arno Welzel <usenet@arnowelzel.de> - 2021-01-31 14:05 +0100
    Re: Fehler bei Ausführung js-Code im WSH Louis Noser <louis.noser.wegwerf@gmail.com> - 2021-01-31 17:44 +0100

csiph-web