Powered by Blogger.
Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Access command prompt of another PC via IP

Saturday, May 23, 2015

1. Download and extract PsTools to "C:\Windows\System32" in both source and target PCs (In my case both are Windows 8).

2. Open command prompt and type:
"reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f"

Following was the output:
The operation completed successfully.

3. Let us access "ipconfig" remotely as an example. Type the following in the command prompt of the source computer.

psexec \\destination_ip_address -u destination_username -p destination_password ipconfig

Note:
If you get the following error, please try the code given below in the remote PC.

Error:
Couldn't access 192.168.1.106:
The network path was not found.

Make sure that the default admin$ share is enabled on 192.168.1.106.

Code to try:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\AutoShareServer Change the AutoShareServer key to 1

Referrences:
1. http://stackoverflow.com/questions/18388381/make-sure-that-the-default-admin-share-is-enable-on-servername
2. serverfault.com/questions/422078/psexec-unknown-user-name-or-bad-password-in-workgroup

Use RtMidi in Windows in a Microsoft Visual Studio C++ Project

Sunday, May 12, 2013

Create a "Win32 Console Application" in Visual Studio.


Name it, click OK.


Click next.


Deselect "Precompiled header" and select "Empty project", click Finish.

Add a C++ (.cpp) file, name it and click Add.


Copy the code of "midiout.cpp" from this link to your .cpp file.
Change "SLEEP" in the code to "Sleep". (Since we are using Windows)
Add "#include " at the beginning of the code.
Copy "RtMidi.cpp", "RtMidi.h" and "RtError.h" files to your project folder. You can find these files from here.

Right click on your project in VS -> Add -> Existing item.
Select and add above three files to your project.


Now your project file structure will look like this.


Add "#define __WINDOWS_MM__" line at the beginning of the "RtMidi.h" file.


Right click on your project in VS -> Properties.


Go to Configuration properties -> Linker -> Input. Add "winmm.lib" at the end of "Additional dependencies".


Click Apply and OK.

Go to Visual Studio project. Press "F7". Press "Control key + F5". Then you can see the command prompt and can hear a short beep. If so, your RtMidi now works fine. Good luck!