| View previous topic :: View next topic |
| Author |
Message |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Tue Mar 29, 2005 2:34 am Post subject: Help with File Processing Command Line |
|
|
I have an application that decrypts files but I dont want to display a dialog. What I want to do is associate the exe (VDS application) in the registry and call the program to unencrypt a file when it is double clicked in Windows. Its probably easy to do but I have not a clue where to start. Do you just pass the filename that is clicked to the VDS script somehow? Sorry new to VDS and learning quickly but used to me perl roots.
Webdaddy _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1564
|
Posted: Tue Mar 29, 2005 3:51 am Post subject: |
|
|
Below is an example of how to setup a file association:
REGISTRY WRITE, HCR, .ext, , File Description
REGISTRY WRITE, HCR, File Description, ,File Description
REGISTRY WRITE, HCR, File Description\DefaultIcon, , "c:\file.exe, 0"
REGISTRY WRITE, HCR, File Description\shell\open\command, , @chr(34)"c:\file.exe"@chr(34) @chr(34)%1@chr(34)
The .ext should be renamed to an extension unique to your program.
The File Description should be unique to your program. Also note c:\file.exe is the actual path and filename to your program; rename that according to your program.
When your program is executed by double clicking on a file with the same .ext extension, the file that is double clicked is passed to your vds exe as the %1 variable. You then can open the file in a listbox to view its data by using the LIST LOADFILE,1,%1 |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Sat Apr 02, 2005 5:07 am Post subject: Thanks Very Much |
|
|
Thank you. You just made my day. I was wondering how the heck to do that. Now my utilities are working correctly. I owe you one. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Fri May 06, 2005 3:06 am Post subject: Oh Not Again |
|
|
I tried the following:
TITLE Single File Decrytion
DIALOG CREATE,Single File Decryption,-1,0,350,50
DIALOG ADD, TEXT,TEXT1,10,10,,,Decryption Module
DIALOG SHOW
WAIT 1
list create,1
LIST LOADFILE,1,%1
LIST SEEK,1,1
info @item(1)
list close,1
wait 30
%F = @filedlg(*.*)
if @null(%F)
goto Close
END
info %F
If you see I have a registry setting as follows:
REGISTRY WRITE, HCR, .3des, , Scribecorp
REGISTRY WRITE, HCR, Scribecorp, ,Scribecorp
REGISTRY WRITE, HCR, Scribecorp\DefaultIcon, , "c:\Transcript2\single.exe, 0"
REGISTRY WRITE, HCR, Scribecorp\shell\open\command, , @chr(34)"c:\Transcript2\single.exe"@chr(34) @chr(34)%1@chr(34)
Now in the first script im not able to read the %1 which is the 3des file that I double clicked on. Does anybody know what im doing wrong.
Before I did a registry merge of the settings a different way and it didnt work when I tried to use %1 as the file location in my script.
Im at a loss. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Fri May 06, 2005 6:53 am Post subject: |
|
|
Hi webdaddy,
I'm not sure of the structure of the file that you're trying to open, but if it does not contain any carriage returns thanyou may not see anything... You load the text of the file into list "1", seek to the second line, then view it...
LIST LOADFILE,1,%1
LIST SEEK,1,1
info @item(1)
Try seeking to line 0... (list seek,1,0)
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat May 07, 2005 9:41 am Post subject: |
|
|
i don't understand either what you are trying to do - are you trying to create a REG file?
serge _________________
|
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Sun May 08, 2005 5:10 am Post subject: Response |
|
|
Yes im trying to associate a file extension to a particular executable that will process the file when it it clicked on. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Sun May 08, 2005 2:06 pm Post subject: |
|
|
What is the script you posted supposed to be doing?
Hooligan  _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Sun May 08, 2005 7:56 pm Post subject: Script |
|
|
I basically have a VDS script that I wrote that needs to work as follows.
When a file with a certain extension is double clicked in the Windows explorer it should launch my VDS program and pass the location of the file clicked to the application so that it can be processed by my program. So far I have been unable to get it to work. I see that you have to do an association in the registry and its supposed to pass the file location as %1 but I have not been able (YET) to get it to work. I am persistant and will figure it out one way or another. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Sun May 08, 2005 8:14 pm Post subject: Status |
|
|
OK tried it both ways. I had this working at one point but cannot get it to work. Here is what I have tried.
35 list create,1
36 LIST LOADFILE,1,%1
37 LIST SEEK,1,0
38 info @item(1)
also tried
35 list create,1
36 LIST LOADFILE,1,%1
37 LIST SEEK,1,1
38 info @item(1)
If you see I let the line numbers in and Im getting a runtime error at line 36 where it is trying to read the %1 variable. If I put it in manually at say line 34 such as %1 = C:\path\to\file.3des it works.
In the windows explorer it is showing up with the correct icons but it does not seem to be passing the file location as %1. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Sun May 08, 2005 8:17 pm Post subject: Entire Application for Review |
|
|
Application that sets the registry entries.
| Code: |
REGISTRY WRITE, HCR, .3des, , Scribecorp
REGISTRY WRITE, HCR, Scribecorp, ,Scribecorp
REGISTRY WRITE, HCR, Scribecorp\DefaultIcon, , "c:\Transcript2\single.exe, 0"
REGISTRY WRITE, HCR, Scribecorp\shell\open\command, , @chr(34)"c:\Transcript2\single.exe"@chr(34) @chr(34)%1@chr(34)
|
Application that I want to associate...
| Code: |
#######################
# LOAD STRING PARSER #
#######################
EXTERNAL STRING.DLL
#DEFINE FUNCTION, STRING
#######################
# LOAD DES ENCRYPTION #
#######################
LOADLIB desdll.dll
#INCLUDE desdsu.dsu
TITLE Single File Decrytion
DIALOG CREATE,Single File Decryption,-1,0,350,50
DIALOG ADD, TEXT,TEXT1,10,10,,,Decryption Module
DIALOG SHOW
WAIT 1
list create,1
LIST LOADFILE,1,%1
LIST SEEK,1,0
info @item(1)
wait 30
%F = @item(1)
if @null(%F)
goto Close
END
%%password = "apassword"
%L = ".1"
%M = ".des"
%A = @DES(FDECRYPT,%F,%%password,%F%L)
%T = %F
FILE COPY, %F%L, @STRING(GetBefore,%F,".", LAST)
FILE DELETE, %T.1
FILE DELETE, %T
list close,1
:Close
exit
|
_________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Mon May 09, 2005 12:48 am Post subject: |
|
|
Try runing this once:
| Code: | | REGISTRY WRITE,HCU,software\Microsoft\CurrentVersion\Explorer\FileExts\.3des,Application,c:\Transcript2\single.exe |
This is only good on a per-user basis... but it should tell you if your program is working... If this does work, then it tells us we can focus on the file association.
Let me know,
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon May 09, 2005 8:48 am Post subject: |
|
|
just guessing here...
1. your extension has 4 characters instead of the usual 3, is that a problem?
2. have you tried @shortname(%1)?
serge _________________
|
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Mon May 09, 2005 3:02 pm Post subject: Hmmm |
|
|
Im gonna try both of those now and see what happens. It could be either one of those issues preventing it from working correctly. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Mon May 09, 2005 3:22 pm Post subject: |
|
|
Webdaddy,
It just dawned on me what your original problem likely was...
Pgware's suggestion had one minor flaw... In the following line:
| Code: | REGISTRY WRITE, HCR, Scribecorp\shell\open\command, , @chr(34)"c:\Transcript2\single.exe"@chr(34) @chr(34)%1@chr(34)
|
... he correctly sent quotes (@chr(34)) around the %1, but VDS interpreted %1 as a variable, which was likely null. Try replacing that line with the following:
| Code: | REGISTRY WRITE, HCR, Scribecorp\shell\open\command, , @chr(34)"c:\Transcript2\single.exe"@chr(34) @chr(34)"%1"@chr(34)
|
This should pass %1 as text...
Let me know...
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|