Questions tagged [python-winshell]

The winshell module is a light wrapper around the Windows shell functionality. It includes convenience functions for accessing special folders, for using the shell’s file copy, rename & delete functionality, and a certain amount of support for structured storage.

See the pypi package index entry for more information.

15 questions
4
votes
2 answers

How to create a shortcut to a folder on Windows?

I have created shortcuts for executables and it works, but when I try to create one for a folder it does not work. It does create a shortcut, it is just not the right 'Target Type'. Please take a look at the image below. Instead of 'File', the…
munoz
  • 65
  • 1
  • 6
3
votes
3 answers

Winshell error win32con not found after installing Python winshell

Traceback (most recent call last): File "C:/Users/owner/Desktop/2/test2.py", line 1, in import os, winshell File "C:\py35\lib\site-packages\winshell.py", line 30, in import win32con ImportError: No module named…
Luke
  • 439
  • 1
  • 12
  • 26
1
vote
1 answer

Unable to run PythonWin For Python 3.9 64bit

I was trying to create Python executables on Windows 10 Pro (latest) so was upgrading to the latest packages but it's changed. I've just gotten rid of Python 3.6 and reinstalled Python 3.9. I then went and installed PythonWin for it using the…
James Rocks
  • 91
  • 1
  • 2
  • 5
1
vote
0 answers

Create windows shortcut with python to "Program Files"

Using below code I'm able to create shortcuts. The problem is when I try to create a shortcut that lead to "Program Files". The resulting shortcut will always end up having Target set to "Program Files (x86)". import os import pythoncom from…
vehovmar
  • 1,557
  • 1
  • 14
  • 24
1
vote
0 answers

why i got an error when i import winshell module?

here is my code: import os try: import winshell except: os.system('python -m pip install --upgrade pip') os.system('pip install pywin32') os.system('pip install winshell') import winshell print('hello world') i want to import…
1
vote
1 answer

Cannot get response to work with ansible script

I have a simple ansible script where I'm attempting to disable the radios. I would like to use win-shell (powershell) to do this but it expects a response but I can't figure out how to make it work: I attempted all kinds of things but this is the…
John Verber
  • 745
  • 2
  • 16
  • 31
1
vote
0 answers

open a python file in pythonwin from command line and set focus to a particular line

from c#, I need to open a file in pythonwin and set the cursor to a particular code area or line number I haveopened the file in pythonwin by giving file path as parameter to the pythonwin exe .. but don't know how to set the cursor
MAXIMUS
  • 11
  • 2
0
votes
1 answer

Error when using winshell module: No module named 'win32'

import winshell r = list(winshell.recycle_bin()) for index, value in enumerate(r): print(index, value.original_filename()) This is the simple script I wrote, but when I try running it (or antyhing else that uses winshell) I get this…
0
votes
1 answer

how can I install win32con?

I'm trying to use winshell to generate a url shortcut file, so I did: pip installed winshell However on line 30 of the winshell.py file it requires the module win32con : my understanding is that win32con is apart of pywin32, which is already…
0
votes
1 answer

Is using a class justified for storing variables that are needed in multiple functions?

I'm writing a python script, and one of its features should be that it automatically adds itself to the windows startup folder. Now I wrote a few functions which would do that for me, but they all rely on multiple variables which shouldn't change…
Elekam
  • 75
  • 1
  • 9
0
votes
2 answers

How to associate .py files to open CMD with `py` then the filename?

How to associate .py files to open CMD with py then the filename? Maybe in a .bat file?
Kainoa Kanter
  • 31
  • 2
  • 4
0
votes
1 answer

Python refuses to recognize library I am almost certain exists

I have no idea why this is so frustrating, but I have literally pulled out a few clumps of hair in rage because this just refuses to work and I honestly do not have the slighest clue on what to do. I am trying to use the winshell module for a quick…
dyl4n130
  • 31
  • 1
  • 4
0
votes
1 answer

winshell.shortcut(parent) giving 'module has no attribute 'shortcut'

-Update at the bottom- pywin32 & winshell installed with no apparent errors, but the following test code (extracted from the example here: winshell examples ): import winshell parent = 'H:\MUSIC\TESTC\TESTTB.lnk' # target is H:\MUSIC\TESTB with…
RFlack
  • 436
  • 1
  • 5
  • 19
0
votes
1 answer

Why does pip install winshell not work on Python v3.4.2?

Install winshell with pip: C:\Users\jonc>pip install winshell Downloading/unpacking winshell Downloading winshell-0.6.zip Running setup.py (path:C:\Users\jonc\AppData\Local\Temp\pip_build_Jonc\winshell\setup.py) egg_info for package…
Jon Cage
  • 36,366
  • 38
  • 137
  • 215
-1
votes
2 answers

How to use Win_Shell to copy paste

I am writing a code which needs enter, copying and pasting: so far I have managed to do the enter with this shell = win32com.client.Dispatch("WScript.Shell") shell.SendKeys("{ENTER}", 0) is there a way to do the same for ctrl c and v pyperclip has…