Page 1 of 1 1
Topic Options
#196815 - 2009-11-23 10:02 PM Command line works but not from script
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Guy's,

This has me puzzled for the last few hours and I just cannot see what is wrong.
I want to use finddupe.exe to find duplicate files in a bunch of folders.
I use the DirPlus UDF to get a list of of folders in a specific location. These folders can have spaces in the names so I need to preserve those to get correct results.
The script below gets me the correct command line results on the screen. I copied and pasted each $shellline in a command windows and all executed correctly. Running them from a script makes finddupe.exe not interpret the redirect to a file correct. It must be something with the quotes but I tried so many variations that I cannot see the correct one anymore.

 Code: 
Break on

$rc = SetOption("WrapAtEOL", "On")

$folders = dirplus("d:\finddupe\test test\", "/ad")

For Each $folder in $folders
	$shellline = 'd:\finddupe\finddupe.exe ' + '"' + $folder + '\**" >"d:\finddupe\duplicates_' + $folder.name + '.txt"'
	? $shellline
	?
	Shell $shellline
Next
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#196817 - 2009-11-24 12:01 AM Re: Command line works but not from script [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
You can't redirect without invoking %COMSPEC% /c, you silly programmer! ;\)
 Code: 
	$shellline = '%COMSPEC% /c d:\finddupe\finddupe.exe "' + $folder + '\**" >"d:\finddupe\duplicates_' + $folder.name + '.txt"'

G-
_________________________
Actually I am a Rocket Scientist! \:D

Top
#196818 - 2009-11-24 12:22 AM Re: Command line works but not from script [Re: Glenn Barnas]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
!##@%%#!%^%$$@#

I knew it was something stupid. That's what you get for looking at the code waaaaay to long. I knew about %compes% for redirecting output just did not notice the absence of it.

Thanks for the reminder Glenn, all works just fine now.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#196825 - 2009-11-24 02:45 PM Re: Command line works but not from script [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
It sucks when you can't see the data array for all the bits, eh? ;\)

G-
_________________________
Actually I am a Rocket Scientist! \:D

Top
#196827 - 2009-11-24 02:57 PM Re: Command line works but not from script [Re: Glenn Barnas]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
"Elements", surely?
Top
#211947 - 2016-09-12 12:13 PM Re: Command line works but not from script [Re: Richard H.]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
LOL \:o This one saved my day again. One would assume that this is something easy to remember but I guess memory starts shutting down when the 30's are over LOL
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#211954 - 2016-09-16 09:17 PM Re: Command line works but not from script [Re: Mart]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Well if it's after 30's what about those near 60
Top
#211955 - 2016-09-17 01:35 AM Re: Command line works but not from script [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Hey! Who you calling ol - er - um - (nevermind). \:D
_________________________
Actually I am a Rocket Scientist! \:D

Top
#211956 - 2016-09-17 01:56 AM Re: Command line works but not from script [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Mart you silly boy
_________________________
!

download KiXnet

Top
#213675 - 2019-04-29 07:47 PM Re: Command line works but not from script [Re: Lonkero]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Good too see that you fixed it ;).
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box
2024-02-09 [RSLHA] No access possible!
2024-02-09 [RSLHA] Database Error!
2024-02-18 [Dr_Rick] What happened to Bruno
2024-03-08 [mole] Thanks for getting the posts back again.
2024-04-17 [MarineV] db errors
2024-04-18 [MarineV] will the db errors get fixed????
2024-04-26 [Tonny] database error, please!
2024-05-09 [NTDOC] I'm not seeing any errors
2024-05-31 [chojin] DB is down again \:\(
2024-06-04 [selsner] Still no access, please help!
2024-06-07 [mole] Looks like DB is back again. Thanks.
2024-06-17 [It_took_my_meds] We encountered a problem. The reason reported was Database error only visible to forum administrators Please click back to return to the previous page.
2024-07-04 [Armin73] There is still a database error 🤷‍♂️
2024-07-09 [0neZero] There is still a database error 🤷‍♂️
2024-07-10 [Allen] DB working a few times in between the messages above. Working again as of 7/10. Thanks Doc
2024-08-31 [NetGnostic] Bummer, the Database error is back.
2024-09-04 [NTDOC] Fourms are back up without error for the moment
2024-10-02 [Arend_] Wll still have database errors ;-)
2024-10-03 [Allen] Thanks to Doc... it's back.
2024-12-09 [chojin] could we move kixtart to a new place in order to keep it living ? maybe create a github page and a subreddit?
2024-12-10 [Allen] do know about moving it, but I know Doc is aware of the DB issue. Should be back online soon.
2024-12-10 [Allen] don't know...
2025-02-09 [Comet] Greetings. I installed KiX on my new Windows 11 computer, and joined this foum. Hello World!
2025-02-10 [Allen] Welcome
2025-02-15 [Glenn Barnas] Discord? Reddit? New URL?
2025-03-07 [Comet] UBB Error We encountered a problem. The reason reported was Database error only visible to forum administrators
2025-06-30 [mole] Thanks for getting this working again.
2025-07-28 [mole] UBB Error We encountered a problem. The reason reported was Database error only visible to forum administrators
2025-08-01 [Arend_] I think it's fixed, I don't have the problem.
2025-10-06 [Comet] The UBB Error no longer happens for me.

Who's Online
1 registered (Allen) and 850 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.258 seconds in which 0.125 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org