Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello eveyone,

I have install a free software that change the protected PDF Files to unprotected. The software run by dragging a PDF files in a desktop icon "PDF unlocker, drop PDF files here".
When I try using it in Windows Run
"C:\Program Files\Freeware PDF Unlocker\unlockpdf.cmd" "C:\Documents and Settings\USER001\Desktop\00000001.pdf", same happens when I drag it to that icon. Both process can convert the file to unprotected.

My problem is when I try using it in my VB6 project. the Command Prompt not appear
VB
Shell """C:\Program Files\Freeware PDF Unlocker\unlockpdf.cmd"" ""C:\Documents and Settings\USER001\Desktop\00000001.pdf"""

Nothing happends when I do the above codes.

Installer name: bs_Free_PDF_Unlocker.exe
Application name: Freeware PDF Unlocker

Please help.
Thanks
Posted
Updated 21-Jun-13 2:21am
v2
Comments
Mike Meinz 21-Jun-13 8:36am    
I think you have to have quotes around the tokens that contain spaces.

Shell "C:\""Program Files""\""Freeware PDF Unlocker""\unlockpdf.cmd C:\""Documents and Settings""\USER001\Desktop\00000001.pdf"
hansoctantan 21-Jun-13 8:43am    
I have "" in each path but when I try using your suggestion, it has an error Run-time Error 5 Invalid procedure call or argument.
Mike Meinz 21-Jun-13 8:53am    
Maybe Solution 2 will work for you. If not, combine Solution 2 and my example to see if that works.

Then, maybe consider upgrading to VB .NET.
hansoctantan 24-Jun-13 4:11am    
don't have a choice, can you give me a sample or maybe a tool that can do this?
i don't have an idea how to do this
Mike Meinz 24-Jun-13 6:07am    
Sorry, I no longer have VB6 to test on so I will be unable to help you any further.

use like this to get the Shell window

Shell "c:\telnet" ,vbNormalFocus

Refer the below link,

http://www.developerfusion.com/article/9/shell-and-shellexecute-function/[^]

Thanks
--RA
 
Share this answer
 
Comments
hansoctantan 21-Jun-13 8:59am    
I also try that and didn't work
I can't remember executing a shell directly, my programs builds them on the fly.
Try the following and see if it works....
shell chr(34) & "C:\Program Files\Freeware PDF Unlocker\unlockpdf.cmd" & chr(34) & chr(32) & chr(34) & "C:\Documents and Settings\USER001\Desktop\00000001.pdf" & chr(34)
 
Share this answer
 
v2
Comments
hansoctantan 21-Jun-13 9:01am    
same happens
Does this work?

shell chr(34) & "C:\" & CHR(34) & "Program Files" & CHR(34) & "\"  & CHR(34) & "Freeware PDF Unlocker"  & CHR(34) &  "\unlockpdf.cmd" & chr(34) & chr(32) & chr(34) & "C:\"  & CHR(34) & "Documents and Settings"  & CHR(34) & "\USER001\Desktop\00000001.pdf" & chr(34),vbNormalFocus 
 
Share this answer
 
Comments
hansoctantan 21-Jun-13 10:39am    
sorry no

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900