shellexecute

Python's win32api only printing to default printer

杀马特。学长 韩版系。学妹 提交于 2020-12-05 11:12:13
问题 I'm trying to use win32api to output a PDF document to a particular printer. win32api.ShellExecute(0, "print", filename, '/d:"%s"' % printername, ".", 0) filename is a full pathname to the file, and printname is the name of the target printer I get by going through the output of win32api.EnumPrinters(6) . The file is sent to the Windows default printer even if printername is the name of a different target (my expectation is that passing a specific printer would send the named file to that

How to keep the window open: ShellExecuteW(0,0,“powershell.exe”, “..”,“..”,SW_SHOW)?

梦想与她 提交于 2020-05-28 04:20:45
问题 from another program (metatrader) I start a ps-script to download some emails: shl = ShellExecuteW(0,0,"powershell.exe", "-file x.ps1","..\\path\\to\\scripts",SW_SHOW); After a couple of weeks without any problem(!) I saw all of a sudden some red error code in the console - but it was closed too fast the return code (shl) signals no error: shl <=32. Now I tried to start ShellExecuteW(..) with shl = ShellExecuteW(0,0,"powershell.exe","..","..",SW_SHOWNOACTIVATE); # SW_SHOWNOACTIVATE = 4 # 4:

How to keep the window open: ShellExecuteW(0,0,“powershell.exe”, “..”,“..”,SW_SHOW)?

余生长醉 提交于 2020-05-28 04:18:53
问题 from another program (metatrader) I start a ps-script to download some emails: shl = ShellExecuteW(0,0,"powershell.exe", "-file x.ps1","..\\path\\to\\scripts",SW_SHOW); After a couple of weeks without any problem(!) I saw all of a sudden some red error code in the console - but it was closed too fast the return code (shl) signals no error: shl <=32. Now I tried to start ShellExecuteW(..) with shl = ShellExecuteW(0,0,"powershell.exe","..","..",SW_SHOWNOACTIVATE); # SW_SHOWNOACTIVATE = 4 # 4:

How to determine if win32api.ShellExecute was successful using hinstance?

守給你的承諾、 提交于 2020-03-18 06:40:14
问题 I've been looking around for an answer to my original issue.. how do i determine (programmatically) that my win32api.ShellExecute statement executed successfully, and if a successful execution occurs, execute an os.remove() statement. Researching I found out that the ShellExecute() call returns the HINSTANCE. Further digging I found that ShellExecute() will return an HINSTANCE > 32 if it was successful. My problem/question now is, how do i use it to control the rest of my program's flow? I

用c++写的无聊小游戏

左心房为你撑大大i 提交于 2020-03-02 16:59:02
同样,不说废话,放代码 # include <iostream> # include <cstdio> # include <iomanip> # include <cstdlib> # include <cmath> # include <ctime> # include <windows.h> using namespace std ; int main ( ) { long long a ; srand ( time ( NULL ) ) ; a = rand ( ) % 10 + 0 ; cout << a ; switch ( a ) { case 1 : ShellExecute ( NULL , "open" , "www.bilibili.com" , NULL , NULL , SW_SHOWNORMAL ) ; break ; case 2 : ShellExecute ( NULL , "open" , "www.baidu.com" , NULL , NULL , SW_SHOWNORMAL ) ; break ; case 3 : ShellExecute ( NULL , "open" , "www.csdn.net" , NULL , NULL , SW_SHOWNORMAL ) ; break ; case 4 : ShellExecute (

Executing .exe from Visual Basic 6

余生长醉 提交于 2020-02-28 07:19:17
问题 I'm new to visual basic. I'm trying to execute .exe file from VB. But I'm not getting the output. My .exe is having command line args. Following is my code Private Sub Command1_Click() Shell "D:\FEP\extractFEPData.exe data.txt", vbNormalFocus End Sub In cmd prompt If I give command extractFEPData.exe data.txt It is parsing the file. But in VB after clicking command button nothing happens. Please help me. 回答1: Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _

Executing .exe from Visual Basic 6

*爱你&永不变心* 提交于 2020-02-28 07:19:09
问题 I'm new to visual basic. I'm trying to execute .exe file from VB. But I'm not getting the output. My .exe is having command line args. Following is my code Private Sub Command1_Click() Shell "D:\FEP\extractFEPData.exe data.txt", vbNormalFocus End Sub In cmd prompt If I give command extractFEPData.exe data.txt It is parsing the file. But in VB after clicking command button nothing happens. Please help me. 回答1: Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _

Perfom a ShellExecute from Firefox Addon

别来无恙 提交于 2020-02-16 06:49:32
问题 In my Firefox extensions I want to open certain files with the "default viewer" for that file type in Windows. So basically something similar to the ShellExecute('OPEN') function call of the Windows API. Is it possible? If so, how can that be achieved? 回答1: Files The closest thing is nsIFile::launch. However, it is not implemented for every conceivable platform (but it is implemented at least for Windows, OSX, GTK/Gnome and compatible, KDE and Android). You cannot use ::launch to instruct the

Perfom a ShellExecute from Firefox Addon

两盒软妹~` 提交于 2020-02-16 06:49:25
问题 In my Firefox extensions I want to open certain files with the "default viewer" for that file type in Windows. So basically something similar to the ShellExecute('OPEN') function call of the Windows API. Is it possible? If so, how can that be achieved? 回答1: Files The closest thing is nsIFile::launch. However, it is not implemented for every conceivable platform (but it is implemented at least for Windows, OSX, GTK/Gnome and compatible, KDE and Android). You cannot use ::launch to instruct the

Trying to call ShellExecute to run Mysql and a sql script

安稳与你 提交于 2020-01-22 00:26:04
问题 I've been trying to use ShellExecute from within a Delphi app to open Mysql and run a script. ShellExecute(Handle, 'open', PWideChar(InpCommandProgram.text), PWideChar(commandline), nil, SW_SHOWNORMAL); InpCommandProgram.text = 'MYSQL' commandline = '--user=root --password=password < C:/directory/filename.sql ' filename.sql has been stripped down to 'Create databasename'. A command window opens briefly and scrolls some messages - too fast to read. If I open a command window and enter the same