winpython / winpython.github.io

contains the Winpython project website
https://winpython.github.io
21 stars 10 forks source link

NoShell.vbs #57

Closed bestickley closed 6 years ago

bestickley commented 6 years ago

Hi, I'm having an issue. I've downloaded WinPython-64bit-3.6.3.0Qt5.exe and ran the executable. Then I double clicked on the spyder.exe but came across an issue in the script, Noshell.vbs. The error was on the line that goes, "CreateObject("Wscript.Shell").Run RunCmd, 0 , True". The error was concerning permissions. I'm on Windows 7 and don't have admin privileges. How can I get around this?

Also, sorry if this is the wrong place to post, wasn't sure where to ask.

Thank you!

stonebig commented 6 years ago

possibilities, by likehood :

bestickley commented 6 years ago

Thank you so much for you response. I will look into each.

stonebig commented 6 years ago

Introduction of noshell.vbs was committed on 5 Mar 2016 https://github.com/stonebig/winpython/commit/a6d358c953756c8979eef94536d8da750923f464, so you may pick a WinPython version older than this date

Windows7 is really bad practice nowodays.

bestickley commented 6 years ago

I've isolated the issue down to to line 9 in the script where RunCmd in the CreateObject() function call is an empty string. I downloaded on my personal laptop and RunCmd gave me "winspyder.bat" but on my work laptop (Win 7 and don't have admin privileges) it give me an empty string. In the comments of the NoShell.vbs it says it's a script on how-to-run-a-batch-file-without-launching-a-command-window, so could I just launch the command window to run it instead? Or would I have to alter the .exe for that?

NoShell.vbs Code: If WScript.Arguments.Count >= 1 Then ReDim arr(WScript.Arguments.Count-1) For i = 0 To WScript.Arguments.Count-1 Arg = WScript.Arguments(i) If InStr(Arg, " ") > 0 Then Arg = chr(34) & Arg & chr(34) arr(i) = Arg Next RunCmd = Join(arr) CreateObject("Wscript.Shell").Run RunCmd, 0 , True End If

I know I should probably pick an older version, and I will, but first I'd like to understand the issue.

Thank you

stonebig commented 6 years ago

You can avoid the vbs layer per calling directly the scripts.

For example, to start Spyder, launch winpython-64bit-3.6.3.0\scripts\spyder.bat

bestickley commented 6 years ago

How do I call directly the script? By double clicking on spyder.bat file? When I do that nothing happens.

Now I'm not getting an empty string. I'm getting a permissions error on the line CreateObject("Wscript.Shell").Run RunCmd, 0 , True

So all I need is a way to bypass this command just like you said, "you can avoid the vbs layer per calling directly the scripts"

stonebig commented 6 years ago

Spyder should start if you click on:

stonebig commented 6 years ago

also as a remark, launching winpython-64bit-3.6.3.0\scripts\make_winpython_fix.bat will patch the spyder.exe, and you will be able to click on it directly. (at the price of loosing movability)

bestickley commented 6 years ago

When I double click on spyder.bat in the scripts folder nothing happens besides a command window coming up then closing. I did a Wscript.Echo right before the CreateObject() command in Noshell.vbs and it showed "winspyder.bat" as the batch file it was trying to run. I've tried double clicking on that too but nothing.

bestickley commented 6 years ago

New Observation: In the cmd inside the WinPython\scripts folder I type spyder.bat and then press ENTER.

I get an error that says, "Unable to create process using "" and THEN it navigates me to the WinPython\notebooks folder... very strange

stonebig commented 6 years ago

"" is typical of spyder.exe being called without the path being modified:

Blind guess, you may have hit the 2048 size limit of your PATH variable.... put Winpython in directory with a smaller path, like d:\wp36 to have d:\wp36\settings\winpython.ini etc...

bestickley commented 6 years ago

-Full Path is: C:\Users\benton.stickley\Documents\WinPython\scripts -Copy of CMD text: C:\Users\benton.stickley\Documents\WinPython\scripts>echo %PATH% C:\Users\benton.stickley\Documents\WinPython\python-3.6.3.amd64\Lib\site-package s\PyQt5;C:\Users\benton.stickley\Documents\WinPython\python-3.6.3.amd64\Lib\site -packages\PyQt4;C:\Users\benton.stickley\Documents\WinPython\python-3.6.3.amd64\ ;C:\Users\benton.stickley\Documents\WinPython\python-3.6.3.amd64\DLLs;C:\Users\b enton.stickley\Documents\WinPython\python-3.6.3.amd64\Scripts;C:\Users\benton.st ickley\Documents\WinPython\python-3.6.3.amd64..\tools;C:\Users\benton.stickley\ Documents\WinPython\python-3.6.3.amd64..\tools\mingw32\bin;C:\Users\benton.stic kley\Documents\WinPython\python-3.6.3.amd64..\tools\R\bin\x64;C:\Users\benton.s tickley\Documents\WinPython\python-3.6.3.amd64..\tools\Julia\bin;C:\Users\bento n.stickley\Documents\WinPython\python-3.6.3.amd64..\tools\n;C:\Windows\system32 ;C:\Windows;C:\Windows\system32\wbem;C:\Program Files\NMCI\EMT;C:\ProgramData\Or acle\Java\javapath;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\A ctivIdentity\ActivClient;C:\Program Files (x86)\ActivIdentity\ActivClient;C:\Pro gram Files\Tumbleweed\Desktop Validator;C:\Program Files\GuardianEdge\GuardianEd ge Clients; -Yes, that is what my winpython.ini file is like exactly

stonebig commented 6 years ago

doesn't give a clue... try renaming "Documents\WinPython" as "Documents\WinP"

bestickley commented 6 years ago

I tried renaming, nothing changed.

I just noticed when I double click on the spyder.bat file in the scripts folder, the CMD opens and then the text, "Access is denied" comes up. I think it's a permissions thing. Does permissions does WinPython require? Doesn't all just run in my WinP folder?

stonebig commented 6 years ago

hum, try decompose the movement:

maybe Spyder somehow remembers now of "winpython" directory, and will feel better with the old naming of directory.

bestickley commented 6 years ago

When I did that I got an "Unable to create process using '""' "

stonebig commented 6 years ago

ok, try launching "wp\scripts\make_winpython_fix.bat" (the last try, then I give up, and yo may try your luck on stackoverflow or with another distro)

bestickley commented 6 years ago

Output on CMD:

patch pip and current launchers for non-move Access is denied. Press any key to continue...

stonebig commented 6 years ago

you may now go to your IT support or stackoverflow for other ideas.

bestickley commented 6 years ago

Will do. Thank you for your support! I really appreciate it.

bestickley commented 6 years ago

Solution was simply changing the location of my WinPython installation from C:\Users\Ben\Documents\WinPython to C:\WinPython

stonebig commented 6 years ago

hum, the path limit of 256 character was so your problem. it can be changed on Windows 10, but I don't know if it's available on windows 7

bestickley commented 6 years ago

Ah, I see. Makes sense. Thanks again!