Getting Istream failed when trying to transfer content from device in WPDApiSample - wpd

i am trying to run the WPDApiSample. When i run the application it prompts me to enter the device number, i enter the device number then it prompts me to enter what i want. I want to send a content from device. so i select option 3. After that it asks me to give the identifier of the object which i want to transfer. (Is identifier is the name of the directory on the phone? How can i move a specific mp3 file, which is located in music directory ?) i enter the name of the directory, then it says that [Failed to get Istream]. What am i doing wrong ? What is correct input?
Thanks in advance.....

select option 2 to enumerate (list) content present on the device. you may also use option 12 afterwards to read properties of a specific object/item.

Related

How do I remove an Error.error file being created and cannot be deleted?

How do I delete/remove the "Error.error" file when the system says it is not there but it is?
The Error.error file was created somehow and I do not know why or how. However, the issue is the system has created this 0 byte file called "Error.error" and it cannot be deleted, even if I try a "permanent" delete command. It also will not allow me to delete any of the folder directory hierarchy in which is resides. When I do try create it, rename it, or create a physical file with the same name and extension, or try to delete this file directly or indirectly I receive the following error message:
"Could not find this item: This is no longer located in C:\maps\test. Verify the items location and try again." Then it list "Error.error" and its information. However, it is there visually.
Any thoughts or suggestions on how to remove or correct?
Thanks!
I had a very similar issue not too long ago where I had a file that was created by another program and whenever I tried to access or delete it, windows would give an error message like "...This is no longer located in...".
If you're having the same problem I was, here's how I got rid of the file. Start a command prompt. In the command prompt, enter a command like del "\\?\<full path to file>". So if your file name is "Error.error" and it is located in the folder "C:\maps\test", the command you would enter is
del "\\?\C:\maps\test\Error.error"
You can delete a folder that windows won't let you access in a similar way by changing the command from "del" to "rd /S".
If you don't know how to start a command prompt, simply click the start button and type "command". The start menu should offer an option named something like "Command Prompt - Desktop app". That's what you need to start.
I found a good explanation of what the "\\?\" means here.

How do I pass values to an non-command line executable with a batch file?

I have an executable that accepts typed user input on three seperate lines on the GUI. The executable also has a button called "create file" that will perform a file creation based on the typed data. My question is how can I automate passing the three typed values into the executable and then execute the "create file" button all from a batch file? I do not have access to the source code so I cannot make modifications there to achieve this.
(Im not able to write comments yet, so I have to use an "answer")
I agree Cebence, as far as I know you need some kind of macro player. Best free I know of is autohotkey (just google for it). It needs a bit reading in at first but is pretty easy to use and very versatile.
Well, this is not really a batch file solution - I don't think one exists. But you could use a tool like Spy++ to find the IDs of the relevant dialog controls and then write a program to:
Launch the executable
Retrieve the main window handle
Send the appropriate window messages
There is probably software out there that can do this. Maybe there's something that you can batch which will just take the process name or ID and pass a single message to it.
If the GUI application doesn't support command-line arguments BAT file will not be of much help here.
What you actually need is some kind of "GUI macro player" application that will execute a script, i.e. macro like this one:
Switch focus to running application named "XYZ"
Find the input box named "text1" and type in "${param1}"
Find the input box named "text2" and type in "${param2}"
Find the input box named "text3" and type in "${param3}"
Find the button named "button" and click it.
I don't know if there are (free) applications that can do this now, but there was a free application called "Act!" or something like it (its icon was a yellow Mickey Mouse glove with a finger pushing a button). It was actually a ZIP file containing a running Windows executable and Delphi application source code, but I can't find it now on PC Magazine's website.
Hope this helps.

Is there a possibility of storing a .txt file in a .exe file or atleast hiding it from user view?

Is there a possibility to include a text file in a .exe file? or atleast hide it from the user view? I mean let us take an example,I have a target.exe file in which it opens and reads the contents of a data.txt file and yes its working perfect with my computer But when i transfer these target.exe file without a data.txt file to some other computer where you dont have the required data.txt file.It results an error and the thing I want you to know is data.txt file has some information like example a contact info which is a confidential text.When someone runs these .exe file he should enter the name and the data is displayed about the contact info but it works only if you have data.txt file. But i want the data.txt file to be hidden it cannot be accessed normally.The data in data.txt file can be accessed only through .exe file.How could I solve it? and remember i should give my friends only the .exe file and using that .exe file they can save thier data and display contact info. Does any one have any idea to do it?
yes, you can include any user data into recource and link it with your .exe
Resources in Windows
Resource compiler reference
LoadResource
If the exe opens the file, then it is nearly impossible to prevent users from accessing the contents of that file. If you store it as a raw resource, then one can use a resource editor to view it. If you do some sort of basic encryption, then using ProcExplorer, one could view string in the process to see the information when the program executes. You could use DRM style protections, but that seems like overkill.
The answer to your general question is yes, you can store resources in an EXE file and then the EXE can open and load those resources at runtime.

How do i specify to start an application in the specified process?

How to specify to start an application in the specified process in command line.I mean let us take a look at the below command
start "cool.mp3"
it opens the file cool.mp3 in the windows media player but i want it to be opened in the VLC player.How do i mention it?How do i tell to open the file in the VLC player or some other real player.Can we mention the application to run in the specified process ? If so how?
start uses the file associations set by the user. If you want a specific program, then just do so:
"%ProgramFiles%\VideoLAN\VLC\vlc.exe" cool.mp3
Also note that the example you gave can never work with start anyway.

Filesystem links on a FAT32 formatted storage

I know FAT32, as well as FAT16/12 neither support symbolic links nor hard-links. However I came up with this idea:
The FAT specification describes that every file is associated with a directory-entry. In my understanding, one could say that a file-entry in a directory somehow or other points to the file's content.
So, how can I define two directory-entries which point to the same file-content? Or, what could prevent me from doing so?
Use case: I have a USB mass storage device for my car radio, and I want to use directories as playlists since the radio software doesn't support playlists. So it isn't important to me how Windows behaves when doing this.
This should work for simple issues. I.e. it works as a hack / workaround and I don't know what happens if you rename / move / remove files. So, you should not do this on your main hdd.
I edited the directory-entries manually using a hex editor. I modified clusters as well as file-sizes and successfully faked hardlinks. My car-radio and even Windows (7, 64Bit) have no problems with playing back the original and "hard-linked" mp3-Files I used.
When I'm opening the device again in the hex-editor none of my modifications are changed back (See chkdsk issue in answer #1 - but as far as I know chkdsk has to be started manually, anyways.
What you are talking about ("two directory-entries which are pointing to the same file-content") are hard links. chkdsk will report them as cross-links and break them, "repairing" the files (in fact making the copies).
MichaelPh posted instructions on SuperUser:
https://superuser.com/a/486829/51237
It's possible to use Disk Probe (on XP only, I've yet to get it to write the changes on Win7) to modify the cluster a FAT Directory references. This method can be used to redirect the DCIM folder (or a subfolder) to point to the folder used by a different scan device.
Whether this is a good idea or not is a different matter and you use this at your own risk.
Insert the Eye-Fi card either in it's USB Card Reader or directly into an SSD slot and note the drive letter it's installed as (assumed to be F:\ for simplicity)
Ensure all Windows Explorer windows for the card and sub-directories are closed.
Run Disk Probe
Select Drives->Logical Volume
In the Open Logical Volume dialog double-click F:\ in the Logical Volumes list
Click the Set Active button for the Handle F: has been selected as. You can leave the handle as read-only for now.
Select Tools->Search Sectors...
Check Exhaustive Search, enter DCIM in Enter characters to search for and Search
You should find a match (mine is at 8192). Select No on the "Found match..." dialog to cancel the rest of the search.
Select Sectors->Read and increase Number of Sectors to at least two so that the whole directory table is included.
Find DCIM in the ASCII on the right of the Disk Probe screen, this is the start of the FAT entry for the directory. Make a note of the hex value of the 27th byte of the record (each entry is 32bytes), this is the directory cluster reference. This value is require to revert the DCIM directory back to normal use if required.
Find the entry for the directory you want to redirect DCIM to and again make a note of the 27th byte in the record.
Go back to the 27th byte of the DCIM record and change it to the value noted in step 11.
Select Sectors->Write and then click Write it on the Write Sector dialog. A warning will come up if you opened the sectors as read-only. Yes to overwrite if you're happy to make the change.
Opening the DCIM directory in Windows Explorer will now show the contents of the target directory.

Resources