FAQ Database Discussion Community


How to understand which MSI file start

windows,windows-installer
I have W8.1 and i need know which MSI file start when OS opening because installation is corrupted and all time i need press cancel. I want delete it to stop starting with Explorer.exe I already tried to deactivate all process in tab process of Task Manager but don't work....

PHP parse int wrong in XAMPP windows

php,windows,xampp,parseint
demo $code = '40001042901'; echo (int)$code; //intval($code) //same I test on linux (Ubuntu) that result is 40001042901 but on windows result is 2147483647, what wrong with that? XAMPP 1.8.3, PHP 5.5.15, Apache 2.4.10 (Win32)...

What is the max length of a share path in windows?

c#,windows
As I read in the MSDN site, for example, the maximum path on drive D is "D:\some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. But when I was created a share with a long path (more than 100 symbols) they trim...

C: Linux to Windows: Sending text file over TCP produces not exact copy on the Windows side

c,linux,windows,sockets,tcp
I'm writing a system to gather software/hardware info on Macs to put it into a Windows-based SQLite3 database. Schema is as following: agent on Mac - gather data, then sends it over Internet, using SSL, to small Linux server in DMZ (this part works as intended so far) Linux server...

Error when adding VideosLibrary capability in app's manifest file

c#,windows,windows-phone,windows-10,windows-10-mobile
According to the documentation, capabilities must be declared when an application requires programmatic access to certain user resources such as the Videos Library. This page of the documentation also states: All Windows Phone capabilities are not available for apps being developed specifically for Windows 10 Insider Preview. I am building...

Vagrant synced folder issue on windows?

windows,html5,apache2,vagrant,atom-editor
I am using vagrant for development of a HTML5 app. I use Apache2 as web server. After I add some lines to my synced json file, my server serves unknown characteres at the end of the file instead of my changes. Any ideas why this strange behaviour happens?

How to use the contents of a text file(tab delimited format) to rename files in a folder?

c,windows,string,rename
I'm trying to make e-certificates to distribute for one of my college events. I used Photoshop to generate batch certificates with different names and roll nos. Now the files are named core_01Data Set 1.jpg, core_02Data Set 2.jpg, etc. In order to distribute them online, they need to renamed and sorted...

Access std::map from different threads

c++,windows,winapi
I have read that std::map is not thread safe. So if I am accessing (read/write) the std::map from different threads, should I simply wrap the relevant code in a critical section? Note: I am using Visual C++ 2010....

How to send Ctrl+S through SendKeys.Send() method to save a file(save as dialog)

c#,.net,windows,sendkeys
I need to save a file which is in an External application using SendKeys.Send() method. The keys needed to be sent are Ctrl+S. I wrote the below code, but its not working: SendKeys.SendWait("^%s?"); // to get the Save As dialog Thread.Sleep(5000); SetForegroundWindow(FindWindow(null, "Save As")); Thread.Sleep(5000); SendKeys.SendWait("xyz"); // Sending FileName ...

c++ 2 ref classes should have acess to one same object of a other class

c++,windows,reference,system,command-line-interface
I have 2 classes let's say class a und b. And even a thrid class c. class a and b should have acess to the functions of the same object of class c. I want to have a member like a reference. So the argument in the construktor of class...

Why doesn't “go get gopkg.in/…” work while “go get github.com/…” OK?

windows,git,powershell,github,go
I try to use go get gopkg.in/fatih/pool.v2 to install pool according to Readme.md, but can't success: C:\Users\xiaona\Documents\GitHub> go get -v gopkg.in/fatih/pool.v2 Fetching https://gopkg.in/fatih/pool.v2?go-get=1 https fetch failed. Fetching http://gopkg.in/fatih/pool.v2?go-get=1 import "gopkg.in/fatih/pool.v2": http/https fetch: Get http://gopkg.in/fatih/poo l.v2?go-get=1: dial tcp 107.178.216.236:80: ConnectEx tcp: A connection attempt failed because the connected party did not...

Java read bytes from Socket on Linux

linux,windows,sockets,network-programming,raspberry-pi
I'm trying to send a file from my Windows machine to my Raspberry-Pi 2, and I have a client and a server. The client should be able to send a zip file over the network to my server on my linux machine. I know my client and server work on...

Media Foundation set video capture frame rate using PROPVARIANT structure

c++,windows,com,ms-media-foundation
I'm writing a media foundation application where I need to set the capture frame rate for a video device. The function I'm writing is something like: bool SetRequestedFrameRate(const size_t requestedFramesPerSecond); where I pass a user-defined integer as the frame rate parameter. I'm following the code snippet on https://msdn.microsoft.com/en-us/library/windows/desktop/ff485859(v=vs.85).aspx : PROPVARIANT...

Programmaticaly pressed Alt + Enter not working

c++,windows,keyboard,console
There is code: keybd_event(VK_MENU, 0, 0, 0); keybd_event(VK_RETURN, 0, 0, 0); Sleep(200); keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0); First line would press ALT, Second line would press ENTER (RETURN), Fourth line would release ALT, Fifth line would release ENTER (RETURN)....

Delete files from folder [Windows]

windows,batch-file
The problem is as follows - I have a text file with an imagelist which contains the names of photos. The photos reside somewhere else on a hard drive. How do I delete/move those photos which names are in imagelist? Is there any batch routine?...

Execute a batch file before executing in a shortcut (.lnk)

windows,batch-file,lnk
I have multiple versions of a program called Siemens NX. NX uses environmental variables for configuration. I need NX 10.0 to use a different set of environmental variables than my NX 7.5 which uses the system environmental variables. Therefore, I have written a batch file that setups the environmental variables...

link.exe returns error LNK1181: cannot open input file 'C:\Program.obj'

c++,windows,visual-c++,linker,linker-error
I'm compiling with a Batch file containing @echo off set link=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link "%link%" external_input.obj periodic_dinger.obj flagger.obj monitor.obj main.obj libGui.lib libCore.lib libCint.lib libRIO.lib libNet.lib libHist.lib libGraf.lib libGraf3D.lib libGpad.lib libTree.lib libRint.lib libPostscript.lib libMatrix.lib libPhysics.lib libMathCore.lib libThread.lib All the objects and libraries are in the same directory, which is...

How does driver signing work when Windows is offline?

windows,cryptography,driver,signing,certificate-authority
I understand the basics of signing. You must have a private key and a certificate (not necessarily) from a reputable certificate authority. You must then have the public key of the signer to verify its integrity. I can see this working online; A site is given a certificate (not necessarily)...

Override .gitattributes text=auto in Windows

windows,git,gitattributes,core.autocrlf
This is pretty unintuitive: C:\python-tdl\examples\termbox>git config core.autocrlf false C:\python-tdl\examples\termbox>git commit termbox.py warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line endings in...

Batch - Comparing two txt files

windows,batch-file,text,comparison
I have some difficulties comparing two txt files with batch. I used the "findstr" function with many option matchings but none works (for example FINDSTR /I /V /B /G:file1.txt file2.txt). I have a first txt file as following: File1.txt Object 1 Argument 50 Object 2 Argument 10 Object 3 Argument...

Checking Blank User Input in Batch file (No Input) [duplicate]

windows,batch-file,cmd,scripting
This question already has an answer here: set /p empty answer crash 1 answer So, I am asking the user to make an selection. The point of this question is to catch if the user hit just entered without any input. My plan is to find out if the...

How does installers check for java version

java,windows,installer
What method(s) is usually used by program installer to check java version? Do they use simple "java -version" command or is there some other more sophisticated ways. *Windows OS

Application is missing required files

c#,.net,windows,winforms,sharpdevelop
Pic of Error: http://s23.postimg.org/7uj6qcxtn/9708083373e57a9ec91e4296e302f88e.png Cannot Download the Application. The Application is missing required Files. Contact Application Vendor For Assistance. So I'm building a windows form application using SharpDevelop 5.2 and I'm trying to make a standalone/version someone else would be able to use on another machine. In sharpdevelop (and visual...

async methods in callbacks

c#,windows,asynchronous,phone
I'm new to Windows Phone programming and I'm having some problems. What I'm trying to do is make a background task that logs each unlock of the Phone but I can't get the writing to the log to work. This is what how I'm registering a background Task: public App()...

sys.argv in a windows environment

python,windows,python-3.x
I'm attempting to learn python using the book 'a byte of python'. The code: import sys print('the command line arguments are:') for i in sys.argv: print(i) print('\n\nThe PYTHONPATH is', sys.path, '\n') outputs: the command line arguments are: C:/Users/user/PycharmProjects/helloWorld/module_using_sys.py The PYTHONPATH is ['C:\\Users\\user\\PycharmProjects\\helloWorld', 'C:\\Users\\user\\PycharmProjects\\helloWorld', 'C:\\Python34\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages']...

win32_physicalMemory.Capacity returns null in powershell

windows,powershell
This is a really weird issue that only occurs on one computer that I've tested on. I have the following line of code: (get-WmiObject win32_physicalMemory -Impersonation 3 -ComputerName "localhost").Capacity which returns null for some reason. However, on the same computer, if I run the command: get-WmiObject win32_physicalMemory -Impersonation 3 -ComputerName...

Is there an equivalent of Java 'volatile' in C++?

java,c++,windows,multithreading
In Java, sometimes when accessing the same variable from different threads, each thread will create its own copy of the variable, and so if I set the value of the variable in one thread to 10 and then I tried to read the value of this variable from another thread,...

UAC error while installing Xampp 1.8.35 on windows 8

windows,xampp,localhost
I am trying to install xampp but before installation it gives me the following error: I have disabled UAC and it gives me this error.When I press ok and install the thing anyway it still won't let start apache and my sql up. Also installation was done in Program file...

Mod Rewrite Maintenance page that uses multiple URLs

windows,.htaccess,redirect,isapi-rewrite
I have a site the uses multiple URLs for a single application. Depending on the URL of the site you will get different content. I need to create a rewrite rule that redirects a user to a different page depending on what URL the user hits. For example: If a...

Why does Windows Server 2008 think Italy should be in W. European Time?

java,windows,timezone
Why does MS Windows (specifically server 2008 here) consider Italy to be in W. European Time when (I think) it should be in Central European Time according to every other source I can find? TZUtil /g gives: W. Europe Standard Time The control panel shows: (UTC+01:00) Amsterdam, Berlin, Bern, Rome,...

Iterate over all links/sub-links with Scrapy run from script

python,windows,python-2.7,web-scraping,scrapy
I want to run Scrapy Spider from my script, but it works only for 1 request. I cannot execute the procedure self.parse_product from scrapy.http.Request(product_url, callback=self.parse_product). I guess it's being due the command crawler.signals.connect(callback, signal=signals.spider_closed). Please advise how correctly go over all links and sub-links. Whole script is shown below. import...

MinGW-W64 linker skipping incompatible files when searching for third-party static libraries

c++,windows,linker,g++,mingw-w64
I'm on Windows 7 64-bit, and I'm compiling with g++ from MinGW-W64. I'm trying to compile an application that I wrote on a Unix computer. I'm running into problems, however, when I try to link against certain third-party lib<name>.lib files. Specifically, I need to link to ROOT libraries. The linker...

Batch script ends after for loop

windows,batch-file
I've got a batch file that executes a program along with sequential (numbered) macros and calls another batch file that monitors when it is finished before it begins the next iteration. I can't use Start /wait or other "ordering" commands when launching the program because it is started with a...

Suppressing system command called from awk script

windows,awk,system
I am currently running this script in Windows 7. So, I have a program that is meant to color-code output from another command (mkmk) and tally up varying numbers of errors and other notable stats, etc. So right now, it starts as a batch file which Turns off echo Sets...

Perl & Regex within Windows CMD Line

regex,windows,perl
Is there anyway to accomplish matching + storing all in one cmd line? So instead of saving the matches to an array: i.e. ($matches) = $filecontents =~ m/.../g ...the matches would save to a *.txt file? I have been experimenting for a couple of days now, and believe that I...

User process can't see global shared memory created by service

c++,windows,security,winapi,memory-mapped-files
I have a Windows service (running in the system process) and a desktop application that need to share a configuration structure. The data originates in the app, but the user process doesn't have permission to create a global memory object so I create it when the service starts using CreateFileMapping()...

Recording the time of the start of a screen touch in PsychoPy on Windows

python,windows,touchscreen,psychopy
I'm helping to implement an experiment using PsychoPy on a Windows 8 tablet. It doesn't seem to be possible to get direct access to touch events through either PsychoPy, or the pyglet or PyGame interfaces. Most other sources I've found have referred to using mouse move events in place of...

A python script that activates the virtualenv and then runs another python script?

python,windows,shell,command,virtualenv
On windows vista, I need a script that starts the activate (to activate the virtualenv) script in C:\Users\Admin\Desktop\venv\Scripts\ And later, in the virtual environment, starts to the manage.py runserver in the folder : C:\Users\Admin\Desktop\helloworld\ how should I do? What modules should I use?...

How to avoid selecting textbox value when press Enter?

c#,windows,enter
Control nextControl; if (e.KeyCode == Keys.Enter) { nextControl = GetNextControl(ActiveControl, !e.Shift); if (nextControl == null) { nextControl = GetNextControl(null, true); } nextControl.Focus(); e.SuppressKeyPress = true; } I have this code to act ENTER Key as TAB but when I press Enter key it is selecting textbox value as in image...

Listing directories by content size using C# [closed]

c#,.net,windows,linq
I'm trying to list all folders of my c drive excluding the document folder which i do not seem to have access to. This first seemed rather simple to me but i found myself still struggling with it despite the seemingly rich .net library. I can't post any code as...

Recursive check files and perform zip if a particular file type exists

windows,powershell,batch-file,recursion,cmd
My Problem statement: Main Folder -SubFolder1 --1.jpg --2.jpg -SUbFolder2 --Subsubfolder ---1.jpg ---2.jpg I have this main folder which has subdirectories and at the last subdirectory, there are images. Now, what I wish to achieve is recursively check if image file(s) exists in a subdirectory If it does, zip all the...

Bottle.py not reloading

python,windows,bottle
So... trying to follow along the Bottle To-Do list tutorial, using WinPython 3.4.3. Basically, I was having fits with the script not reloading, despite having run(host='localhost', port=8080, reloader=True, debug=True) set at the end of the file. After trying the same tutorial @ home with no problems (using Linux), I figured...

Installing packages with pip with multiple python installs

python,windows,pip,anaconda
I have been using Anaconda python on Windows 7, but a package I need isn't supported by Anaconda python, so I installed CPython from python.org. I'd like to install the package to CPython, but pip still installs everything to C:\Anaconda\ ...\site-packages. How can I change this?

C# - Numbering lines in richTextBox Windows Forms

c#,windows,forms,lines
got a problem that can't deal with. I'm trying to number all lines in richTextBox, program does work, but it crashes when I click on my numbering button. Can anyone explain me please why? Code: public string temp = null; private void button1_Click(object sender, EventArgs e) { int i; for...

Would using Vagrant be overkill? [on hold]

python,windows,ubuntu,vagrant,virtualbox
I'm a developer-hobbyist running Windows 8.1 on a Yoga 2 Pro. I mostly do Python/Django work but I think I'm gonna pick up Ruby soon. The thing is, Windows always seems to be the limiting factor for any project I want to pick up. Last time I tried to install...

How to extract a string from the first line of a file using batch?

windows,batch-file,cmd,batch-processing
I have these files that contain a name in the first line I wish to extract. All the methods I have approach either result in error or give me nothing. An example file can be found here: https://www.dropbox.com/s/0kcgj8vr3wii33s/FORS2.2011-10-23T23_59_20.355_out.fits?dl=0 I wish to extract "PN-G013.3+01.1", which lies on the first line (column...

CMD script Malfunctioning

windows,cmd
I have a cmd script that simply runs a windows 7 custom theme-pack (you can download it here.) The file can be downloaded here Whenever I run it, the files malfunctions (read below for a description of the malfunctioning) The file's contents echo off color a title "System Shutdown Manager"...

Unable to edit netbeans.conf

java,windows,netbeans
I am trying to modify 'netbeans.conf' located at following path: C:\Program Files\NetBeans 8.0.2\etc When i modify the file; add -J-Dfile.encoding=UTF-8 In Notepad, it is not allowing me to save the original file. In Notepad++, it says 'please echeck if this file is opened in another program'. Netbeans is installed in...

Bug in FFI when passing CString followed by an int

windows,rust,32-bit,ffi
My Rust test code extern "C" { fn test_int_only(n : libc::c_int); fn test_int_and_str(s : CString , n : libc::c_int); } pub fn test1() { unsafe { test_int_only(0); test_int_only(1); test_int_only(2); test_int_only(4); test_int_only(-12); } } pub fn test2() { unsafe { test_int_and_str(CString::new("Foo").unwrap(),0); test_int_and_str(CString::new("Bar").unwrap(),1); test_int_and_str(CString::new("Baz").unwrap(),2); test_int_and_str(CString::new("Fub").unwrap(),4); test_int_and_str(CString::new("Bub").unwrap(),-12); } } My C code void...

minigw-w64 is incapable of 32 byte stack alignment, easy work around or switch compilers?

c++,windows,gcc,alignment,sse
I'm trying to work with AVX instructions and windows 64bit. I'm comfortable with g++ compiler so I've been using that, however, there is a big bug described reported here and very rough solutions were presented here. Basically, m256 variable can't be aligned on the stack to work properly with avx...

How to take name from file with specific extension and use it as variable in batch script?

windows,variables,batch-file
Can anyone tell me how to take name from specific file with specific extension (.pdf) and use it as variable? Thanks in advance...

ICorProfilerCallback2: CLR profiler does not log all Leave calls

c#,.net,windows,performance
I am trying to write a profiler that logs all .Net method calls in a process. The goal is to make it highly performant and keep let's say the last 5-10 minutes in memory (fixed buffer, cyclically overwrite old info) until the user triggers that info to be written to...

Building vtk with QT5 windows 8

windows,cmake,qt5,vtk
I'm facing a rather weird error. I can see on the wiki that we can build vtk with support for qt5. However, when trying to do so and first configuring with cmake I get the following output: CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindQt4.cmake:1326 (message): Found unsuitable Qt version "5.4.2" from...

Using single precision floating-point with FFTW in Visual Studio

c++,windows,visual-studio-2012,fftw
I am trying to use the FFTW library in a Visual Studio project, and I am having trouble with getting the floating point precision to work. I have created the library files and linked them as in this post and I have only included the libfftw3f-3.lib library as it says...

MoveFileEx() File removal on reboot

c++,windows,winapi
Currently I can remove a directory on reboot. Im currently doing this by using the MoveFileEx function along with passing the MOVEFILE_DELAY_UNTIL_REBOOTconstant. My question is if I have the following: Directory 1 and inside I have Directory 2... Directory 2 is unistalled which means the directory needs to be removed...

MFC application Crashes in NTDLL.dll

windows,mfc,crash,ntdll
I have an MFC based application. It keeps looking for a file after few seconds (using CreateTimerQueueTimer based timer) and perform some action. This is always crashing (for unknown reason) on XP. This application works fine on windows 7 and windows 8. But problem on XP is persistent. Below is...

ffmpeg: wmv files generated on Mac can't be played in Windows

windows,osx,ffmpeg,file-conversion,wmv
On Mac OS X 10.6.8, I converted a animated gif to a video file in wmv (a requested file format) by using ffmpeg -i File.gif -s 400x400 NewFile.wmv The video file played fine using VLC on Mac. The file can't be played on a Windows 7 machine using the Windows...

Which is better for MFC application hot key or Accelerator?

c++,windows,visual-c++,mfc,keyboard-shortcuts
We have MFC application which has around 10 image buttons to which we want to provide shortcut keys. Shortcuts will be customizable. I have implemented shortcuts (with no customization right now) with hotkeys using ON_WM_HOTKEY() message. After searching through Goolge I am little confuse. For example, this question is suggesting...

String manipulation with batch scripting

windows,string,batch-file,space
I need to save the variable in %%c temporarily which comes from a for loop. But when I try to do that, the content changes unexpectedly. Some space characters appear at the end of the string. The content of %%c is a.jpg by the way. echo %%ca REM prints a.jpga...

Windows/Linux child process STDIN differences

linux,windows,perl,process,stdin
I built a simple text processing script at work to be used by another program. When I was done, someone remembered that the script needs to not block STDIN/STDOUT for the tool using it to work right, and modified the script accordingly. The script opens *nix's cat in a subprocess...

Get the PID of a Windows service by the name of the service

windows,batch-file,service,cmd,pid
Is there a way of getting the PID of a windows service with a command in a batch script by just knowing the name of the service?

MongoDB CountAsync and Cursors not working in a Windows Service with the new driver

c#,windows,mongodb,service
I have a Windows Service that reads data from a SQL Server and write them on MongoDB. I'm trying to adapt this service to the new MongoDB driver (using 2.0.1 version), but I'm facing some problems. I have this: protected void OnStart(string[] args) { threadExternalPage = new Thread(new ThreadStart(FacadeFactory.GetLivePrice.UpdateExternalPage)); This...

Parsing the text file line-by-line using batch script (batch file)

windows,batch-file,scripting,cmd
So, I am programming in the batch script and I came across this issue. The following code will take yourwords.txt file and parse it. The existedWord variable will have the last word of the text file. So, everytime when I run this program it will only compare the user's input...

Where is git command after installing “GitHub for Windows”? [closed]

windows,git,powershell,github,github-for-windows
After installing GitHub for Windows, I can use git command in Powershell directly: C:\Users\xiaona\Documents\GitHub> git usage: git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>] The most commonly used git commands are: add Add file contents to the index bisect...

Automate MySQL backup @localhost with mysqldump in Windows 8

mysql,windows,operating-system,scheduled-tasks,mysqldump
I'm trying to set up a task in Windows 8 to automate my localhost db dump. I've created the task to run daily with the following command line: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe and parameters: --user=root --password=donttellya --result-file=dumped.sql mydb It works but doesn't terminate (running in the tasks list). Also, I'd...

Why doesn't “Set-Item” work on Windows 7 PowerShell?

windows,powershell,raspberry-pi
I am trying to install Windows 10 IoT on my Raspberry Pi 2. The PowerShell documentation tells me to put in this: Set-Item WSMan:\localhost\Client\TrustedHosts -Value <minwinpc> However, when I put it into my Windows 7 PowerShell, this comes out: At line:1 char:54 + Set-Item WSMan:\localhost\Client\TrustedHosts -Value <minwinpc> + ~ The...

I cannot use the msg command in cmd (or batch for that matter). How can I fix this?

windows,batch-file
While in cmd or making a batch file, I cannot use the command msg. When I try to use it, it returns the error msg is not recognized as an internal or external command, operable program or batch file." I'm pretty sure the error is that im missing a msg.exe...

Batch file to open multiple instances of cmd and run Ruby script in each instance

ruby,windows,batch-file,cmd,watir-webdriver
I'm trying to open multiple instances of cmd up which each run a ruby script at the same time. For background into the scripts, each of these ruby scripts run watir-webdriver and spawn new browser instances. All of this should happen instantaneously. Here's what I've tried: start cmd /k cd...

String parsing with batch scripting

windows,string,parsing,batch-file,xml-parsing
I have a file called pictures.xml and it contains some pictures information like: <ResourcePicture Name="a.jpg"> <GeneratedPicture Name="b.jpg"/> <GeneratedPicture Name="c.jpg"/> </ResourcePicture> <ResourcePicture Name="z1.jpg"> <GeneratedPicture Name="z2.jpg"/> <GeneratedPicture Name="z3.jpg"/> <GeneratedPicture Name="z4.jpg"/> </ResourcePicture> What I want do do is to get each line in for loop and print the names of the pictures. Sample...

How to execute four queries once and then check success or failure?

vb.net,windows,visual-studio-2010,ms-access
I need to execute four queries and then if there is success must return true otherwise false. The queries affect the database but the function returns false Private Function save_to_data() Dim success As Boolean = False Dim conn As OleDbConnection = GetDbConnection() Dim total_due As Decimal = sanitize(txt_total_due.Text) Dim amount_paid...

Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?

windows,sockets,winsock,winsock2
I'm developing a server-client application using WinSock. Does using the same WSAOVERLAPPED with both WSASend and WSARecv works well? Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?...

how to change Text to Speech voice and how to insert characters into char array

c++,arrays,windows,winapi,text-to-speech
I need to change the voie of the Text To Speech engine. when a menu is selected ID_SPEAK_PLAY I get the text of an edit box and simply read it. my situation can be solved in two ways : insert the XML code at the begining of ptrData without using...

ShellExecute doesnt work if some parameters are just int type

c#,windows,shell,interop
I have the below code which is to launch any .exe (in this example its notepad.exe). But this code is not working. though there are no compilation issues. [DllImport("shell32.dll", CharSet = CharSet.Auto)] static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo); public static void exev() { SHELLEXECUTEINFO info = new SHELLEXECUTEINFO(); info.cbSize =...

Programmatically close Windows console application c++

c++,windows,mutex,handle
I need my windows console application to be run only in one instance (i.e. Only one instance of the application can be run at a time). Here's what I have: int _tmain(int argc, _TCHAR* argv[]) { PCTSTR Name = TEXT("AnyName"); HANDLE h = CreateMutex(NULL, FALSE, Name); if (GetLastError() == ERROR_ALREADY_EXISTS)...

Increment Serial Number using EXIF

windows,powershell,command-line,exif,exiftool
I am using ExifTool to change the camera body serial number to be a unique serial number for each image in a group of images numbering several hundred. The camera body serial number is being used as a second place, in addition to where the serial number for the image...

Is there a way to close a single window of a process from a BAT file?

windows,batch-file
Here's my situation: I have my Windows 7 computer set up so that every morning, a task runs that plays my alarm and causes my morning routine to open up (in a WordPad window). The thing is, I would like to also have the window automatically close at the time...

Apache - finding configuration file path

windows,apache,server
I have to migrate another apache instance from 2.2 to 2.4 but I have one problem. In Apache monitor I see multiple services running but I don't really know where apache .conf files are stored. In previous migrations from 2.2 to 2.4 I had them somewhere within conf folder. Apache...

Dump raw image data

c++,windows,image,raw-data
I have an image stored in memory in the form of raw bytes i.e. I have a char* pointing to the memory location of the image data. Now, I need to somehow validate if the image data is legitimate. What I have currently tried is to simply dump the bytes...

Schedule daily task in a Python app

python,windows,scheduled-tasks
I'm fairly new at Python in general, but I'm trying to create a small background application that will read an excel file and send me an e-mail every day on some condition. I was wondering what is the best way to go about this? Should I just use some sort...

If exist and errorlevels in a batch (.bat) file

windows,batch-file,command-line
I'm trying to run a delete command on the result of an SQL command but only if it returns an error code of 0. Below is my code: SqlCmd command... REM if SqlCmd command is successful run the below if exist statement if errorlevel 0 ( REM if the file...

Windows Store App - Dynamic Binding

c#,windows,windows-store-apps,winrt-xaml
Need a second set of eyes. I am dynamically populating a hub control with text boxes, check boxes, etc... As I do this I am adding databinding to each control as I add it. The problem is that any changes made after the load event are not registering properly. Basically...

Issue finding exe path of all windows in python

python,windows,winapi
I am using the code below to determine the foreground window and find the path for the .exe file that created it. hwnd = win32gui.GetForegroundWindow() _, pid = win32process.GetWindowThreadProcessId(hwnd) hndl = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION | win32con.PROCESS_VM_READ, 0, pid) path = win32process.GetModuleFileNameEx(hndl, 0) print path This workd for windows such as Google Chrome,...

Execute multiple command lines with multiple arguments

python,windows,batch-file,python-3.x
I can't figure out why my command lines doesn't function. I tried subprocess.Popen()` function : `Popen('C:/Test/test.exe -scan "C:/Users/Vince/test.txt" "C:/Users/Vince/test.xml"', cwd='C:/Users/Vince/Working_Directory') But when I run a batch file from my Python program by using os.system("E:/test.bat"), it functions. Here is the content of my batch file: C: cd Users\Vince\Working_Directory C:\Test\test.exe -scan "C:\Users\Vince\test.txt"...

Slow start-up of large programs

windows,optimization,loading
The following program #include <stdio.h> int main() { static char a[1 << 28] = {1}; printf("%d\n", a[0]); return 0; } Compiles on Windows 7 x64 to this executable 19/06/2015 21:57 268,519,936 a.exe Which takes 5.6 seconds to run, even when run several times in succession to make sure it's cached...

How to write the content in MS Excel 2007?

windows,excel
Consider I have a Excel sheet and when I (typed the data in the A1 cell that will automatically load on the Cell B1 How can I do that in the Microsoft Excel 2007?.. Please give a solution for that.. Thanks in advance.....

How to detect after system boot if the service is running, if running then start my apps?

windows,vbscript
In VBScript is it possible to query a specific service name if it's started or running? if its running then execute finally my application. So here is how the flow i am trying to prepare: System is booted Windows 8.1 Startup script is executed (VBS) VBScript now wait and keep...

How to set the classpath in Windows Command Line correctly

java,windows,command-line,classnotfoundexception
I have made many attempts to enter a command to run a JAR file correctly from the terminal, and I am 100% sure that all the JAR files and such are in the given paths, but I keep getting a ClassDefNotFoundException. Does it have anything to do with the way...

How to handle the File hand-off from windows in a python program

python,windows,pdf,file-io
I want to set up my python program to process all pdfs that are opened on my system, and then hand the processed pdf off to a standard reader. So I register my program with windows as the default handler for .pdf files and windows presumably will run my program...

Get Offline Installation ID (Windows 8 or similar)

c#,windows,installation
Is it possible to get the Windows Offline Installation ID (OfflineInstallationId was found in slmgr.vbs)? This can be achieved on the command-line with: slmgr.vbs /dti This returns the Installation ID without spaces or dashes, is it possible to retrieve this in C#? I want to eventually have each block of...

I can't mkdir() , and so , i can't upload files

php,windows
I'm trying to upload an image to a folder with the date of uploading but when i'm trying to execute the code it shows this error : Warning: mkdir(): No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\code\members\action\addc_do.php on line 63 Warning: move_uploaded_file(upload/2015-06-21/c49a7b2f6945d903988b17e91d7e6c91.png): failed to open stream: No such...

bat file script to check if string contains other string

windows,batch-file,cmd
I need to write a batch file that will check if a variable contains specific value. I tried to do the following: If "%%a"=="%%a:%pattern%" ( echo Yes ) else ( echo No ) input example: %%a="bob binson" %patern%="binson" I never get Yes printed! can anyone please tell what i missed...

Windows script batch to copy files from different folders to other folders

windows,batch-file,cmd
The easiest way to explain the problem is by an example. I want to do something like this: file x in /path_1/A/x copy in /path_2/A/ file x in /path_1/B/x copy in /path_2/B/ ... ... file x in /path_1/Z/x copy in /path_2/Z/ From command line with a script in Windows....

Why is csc.exe crashing when I last left the output encoding as UTF8?

c#,windows,command-line,csc
I am having am having or have run into a very strange thing. I wonder if others have and why it's happening. Having run a one line program with this line System.Console.WriteLine(System.Console.OutputEncoding.EncodingName); I see the Encoding is Western European (DOS) Fine Here is a list of some codepages 1200 Unicode...

Find the path of every running process in Python

python,windows,process,path,psutil
I want to find the path of every running process in windows. I tried to use the psutil module but it doesn't show me all the paths. It can't find many processes' paths because of the error: "psutil.AccessDenied" c = wmi.WMI() for process in c.Win32_Process(): p = psutil.Process(int(process.ProcessId)) try: path...

Run server in cmd in Windows

php,windows,wamp
I created a simple client server codes in PHP and I run it through Wamp server localhost in browser. It works but when I run it in cmd, the output looks like this : c:\wamp\www\Converter>php testserver.php PHP Fatal error: Call to undefined function socket_create() in C:\wamp\www\Converter\testserver.php on line 15 PHP...

Batch file to conditionally execute ifortvars.bat

windows,batch-file,cmd,fortran
I am using a make.bat file to compile my Fortran code. To compile using the ifort command, I first need to initialize the compiler by executing ifortvarsbat intel64 command where I had to setup the path variable. This works fine, however, the path keeps increasing in size and says command...

Nokogiri on Windows with Ruby 2.1

ruby-on-rails,ruby,windows,nokogiri,ruby-2.1
When I try to run my application I get a nokogiri error (full trace below). I understand that nokogiri doesn't support Windows on ruby 2.2, but I'm using 2.1.5 so it seems like it shouldn't be a problem. The gem installs perfectly when I do gem install -v 1.6 so...

How Can We Clear the Screen in Iex on Windows

windows,elixir
Please how can we clear the screen in Iex on Windows Documented method in Iex help does not work: clear/0 — clears the screen This StackOverflow Answer also does not work in Windows....

Get host computer information from within R code

r,windows,server
I'm developing an R script on a local machine and intend to use in in the future on a server. There are slight differences in initial setup of section of the script depending on the machine used, and what I'd like to achieve is to use some control sequence in...

JSON in Python: encoding issue on OS X, no issue on Windows

python,json,windows,osx,encoding
I have a file log.json that contains one line: {"k":"caf\u00e9"} I run the following code on Windows 7 SP1 x64 Ultimate: import json a = json.load(open('log.json', 'r')) f = open('test.txt', 'w') f.write(a['k']) I don't have any issue. When I run the same code on Max OS X 10.10 x64: Traceback...