Welcome Guest.   Make a donation to an author on the site November 24, 2014, 06:37:24 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: sike 1.0 - send file(s) to recycle bin via command line  (Read 6679 times)
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« on: May 11, 2010, 05:27:29 PM »

sike is a command line .exe that sends files/folders to the recycle bin.

Download:  http://www.favessoft.com/downloads.html

Just copy sike.exe to a folder in your path.
sike creates no files, registry or .ini settings.

sike with no params brings up a usage dialog.

Usage: sike [-f] filename1 filename2 ... [may use wildcards]

If -f is not the first param, a confirmation dialog will display,
otherwise sike will loop through the rest of the params sending
files/folders to the recycle bin.

It should work on any Windows flavor that the latest AutoIt3 works on.

It is free for you to use at your own risk.

(There may be a bunch of these around already but I didn't find one that
worked on Vista64 out of the box.  So I knocked this off in AutoIt3.)
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
mouser
First Author
Administrator
*****
Posts: 33,693



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: May 12, 2010, 09:50:44 AM »

thanks for sharing  thumbs up
Logged
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: May 12, 2010, 01:17:49 PM »

smiley
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
justice
Supporting Member
**
Posts: 1,889



Solve issues simply.

View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: June 11, 2010, 03:51:32 AM »

excellent idea
Logged

majoMO
Participant
*
Posts: 43

View Profile Give some DonationCredits to this forum member
« Reply #4 on: June 11, 2010, 07:02:46 AM »

Hi MilesAhead,

FYI, it doesn't work if the filename has some uncommon characters, like: á - ô - ü

E.g.: "mçfilè.txt"

EDIT: if  use it in a .bat file doesn't work - if I use it in a command prompt no annoyances...
« Last Edit: June 11, 2010, 07:08:21 AM by majoMO » Logged
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: June 11, 2010, 01:20:54 PM »

excellent idea

Thank you. smiley
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: June 11, 2010, 01:40:17 PM »

Hi MilesAhead,

FYI, it doesn't work if the filename has some uncommon characters, like: á - ô - ü

E.g.: "mçfilè.txt"

EDIT: if  use it in a .bat file doesn't work - if I use it in a command prompt no annoyances...

Thanks for reporting that info.  On the special characters I believe that is because AutoIt3 itself is ansi. It doesn't support unicode afaik. The command line parsing is a built in feature where you are presented with an array of the command line args: $CmdLine where the first element is the count and the rest of the elements correspond to an arg.  I don't know if there's any easy way to correct it. I'll see if I can find a fix on AutoIt3 forum.

As for the batch file, what kind of error do you get?
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: June 11, 2010, 02:38:06 PM »

Hmmmm, I don't seem to be having much luck with the unicode.  I found some posts on AutoIt3 forum and it seems there's confusion if the command prompt or run box support unicode or what the issue is. There doesn't seem to be a simple way to accommodate it that I can find at present.
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: June 11, 2010, 03:21:18 PM »

If you are willing to try some test apps I can try a few things out.  To be honest though, unicode is new to me.  I've just done stuff for English language and ansi.

I compiled this test app with a unicode directive.  I'd like to see if it actually has any effect.  All it does is pop up a box with the command line arguments displayed.

TestCmdLine one two three

but with args that have unicode characters should test if this approach is feasible.

If run with no args it just pops up a MsgBox with Usage: msg.

The zip just contains the compiled AutoIt3 script(without any UPX compression)

(edit: actually the directive was to use UTF-8.)


* TestCmdLine.zip (330.97 KB - downloaded 156 times.)
« Last Edit: June 11, 2010, 03:26:21 PM by MilesAhead » Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
majoMO
Participant
*
Posts: 43

View Profile Give some DonationCredits to this forum member
« Reply #9 on: June 11, 2010, 04:11:22 PM »

As for the batch file, what kind of error do you get?

No error at all. It just doesn't copy to recycle bin only.

  • TestCmdLine

Bat file with:TestCmdLine.exe sike.exe "mçfilè.txt":



Bat file with:TestCmdLine.exe sike.exe "my.txt":



  • All-round

If I use a .bat file I need to use this to work well:

@echo off
for /f "tokens=2 delims=:" %%a in ('2^>nul chcp') do set cp=%%a
>nul 2>&1 chcp 1252

sike.exe "mçfilè.txt"
>nul 2>&1 chcp%cp%
exit

If I use only «sike.exe "mçfilè.txt"» it doesn't work.

Hope this help.
Logged
daddydave
Supporting Member
**
Posts: 818



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #10 on: June 11, 2010, 04:45:43 PM »

Not sure if this would help, but is the batch file itself saved in Unicode or ANSI?

By the way, AutoIt3 has supported Unicode since version v3.2.4.0 but I too don't have much experience with trying to use it in DOS embarassed the command prompt.  

Nice workaround, majoMO!

« Last Edit: June 11, 2010, 04:50:44 PM by daddydave » Logged
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: June 11, 2010, 05:19:11 PM »

(delete please)
« Last Edit: June 11, 2010, 05:29:19 PM by MilesAhead » Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #12 on: June 11, 2010, 05:27:59 PM »


As for the batch file, what kind of error do you get?

No error at all. It just doesn't copy to recycle bin only.

  • TestCmdLine

Bat file with:TestCmdLine.exe sike.exe "mçfilè.txt":



Bat file with:TestCmdLine.exe sike.exe "my.txt":



  • All-round

If I use a .bat file I need to use this to work well:

@echo off
for /f "tokens=2 delims=:" %%a in ('2^>nul chcp') do set cp=%%a
>nul 2>&1 chcp 1252

sike.exe "mçfilè.txt"
>nul 2>&1 chcp%cp%
exit

If I use only «sike.exe "mçfilè.txt"» it doesn't work.

Hope this help.

Ok so you are saying you have to use the batch file work-around no matter which program you use in the batch?  If that's the case then it looks like the UTF-8 directive is worthless.
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #13 on: June 11, 2010, 05:30:48 PM »

Not sure if this would help, but is the batch file itself saved in Unicode or ANSI?

By the way, AutoIt3 has supported Unicode since version v3.2.4.0 but I too don't have much experience with trying to use it in DOS embarassed the command prompt. 

Nice workaround, majoMO!



You're right. I confused this with an issue I had with ahk.  AutoIt3 no longer supports Win9x etc..
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #14 on: June 11, 2010, 05:34:47 PM »

What they say on AutoIt3 forum seems to indicate the command prompt and run box don't support unicode.
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
majoMO
Participant
*
Posts: 43

View Profile Give some DonationCredits to this forum member
« Reply #15 on: June 11, 2010, 05:47:21 PM »

Sorry but seems that I don't understand (the boxes that comes out are in screenshots).   Roll Eyes

What I do is (in .bat):
TestCmdLine.exe sike.exe "mçfilè.txt"

Output:
-[0]|2
-[1]|sike.exe
-[2]|mĂľfilĂž.txt

In start > run > cmd :
TestCmdLine.exe sike.exe "mçfilè.txt"

Output:
-[0]|2
-[1]|sike.exe
-[2]|mçfilè.txt

If this isn't what I should to do please give me an example (english isn't my native language....).   stars
Logged
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #16 on: June 11, 2010, 05:52:42 PM »

If daddydave and the guys at AutoIt3 forum are right and the issue is the command prompt, maybe this page will be more helpful:

http://www.dpawson.co.uk/xsl/sect2/Unicode.html

Supposedly it fixes up the command prompt to deal with UTF-8.

edit: I've been looking around for a freeware command shell for Windows with unicode support but so far I haven't found anything.
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
majoMO
Participant
*
Posts: 43

View Profile Give some DonationCredits to this forum member
« Reply #17 on: June 11, 2010, 06:00:44 PM »

It seems that the problem is with OEM encoding (and DOS...).

This info could be useful: http://stackoverflow.com/...ode-page-is-cmd-exe-using
Logged
daddydave
Supporting Member
**
Posts: 818



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #18 on: June 11, 2010, 06:08:14 PM »

If daddydave and the guys at AutoIt3 forum are right

I don't know enough about the subject to have an opinion but it interests me and I'm glad you're digging into it.  I'm thinking this probably impacts the command line mode of my NANY 2011 project as well.

What if the command is launched from FARR and the command line args go there?
Logged
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #19 on: June 11, 2010, 06:24:16 PM »

If daddydave and the guys at AutoIt3 forum are right

I don't know enough about the subject to have an opinion but it interests me and I'm glad you're digging into it.  I'm thinking this probably impacts the command line mode of my NANY 2011 project as well.

What if the command is launched from FARR and the command line args go there?

majoMO's TestCmdLine example seems to work fine from FARR.
edit: well, the filename looks like it should. I just pasted from the page here.
But I get some sort of transparent window that disappears only when I close FARR.
Who knows?

« Last Edit: June 11, 2010, 06:26:22 PM by MilesAhead » Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #20 on: June 11, 2010, 06:29:12 PM »

The funny thing is the whole program is only 20 lines of code.  To get it to work with non English environment will probably end up being 80 screens. smiley
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
daddydave
Supporting Member
**
Posts: 818



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #21 on: June 11, 2010, 06:33:13 PM »

So the reason it gives me no problem in Windows 7 x64 is that I have a U.S. version?



Screenshot posted for your amusement. Yes, I still use the old COPY CON and Ctrl-Z method sometimes. smiley
Logged
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #22 on: June 11, 2010, 06:35:31 PM »

When I follow the instructions on that Unicode page I posted, making a cmd prompt using Lucinda font etc... it works on the command line.  At least with the mçfilè.txt file by itself at any rate.

edit: the prompt seems to be persistent... keeping the code page setting (I assume, since the thing seems to work.. sends the file to the bin) it may be worth just making a prompt for stuff where you will use non English characters.  There must be a freebie someplace where all this is automatic. I can't believe we're the first to run into it.
« Last Edit: June 11, 2010, 06:38:51 PM by MilesAhead » Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
MilesAhead
Member
**
Posts: 5,052



View Profile WWW Give some DonationCredits to this forum member
« Reply #23 on: June 11, 2010, 06:36:47 PM »

So the reason it gives me no problem in Windows 7 x64 is that I have a U.S. version?
 (see attachment in previous post)
Screenshot posted for your amusement. Yes, I still use the old COPY CON and Ctrl-Z method sometimes. smiley

See my previous post.
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
daddydave
Supporting Member
**
Posts: 818



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #24 on: June 11, 2010, 06:38:43 PM »

The cmd /u? I didn't have to do anything special for it to work both on the command line or a batch file. What region is your version of Windows?
« Last Edit: June 11, 2010, 06:40:22 PM by daddydave » Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.042s | Server load: 0.28 ]