FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Visual batch file using fivewin
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM

Visual batch file using fivewin

Posted: Tue Sep 02, 2008 11:42 PM
How far can I use fivewin to visualize that batch dos file :
I need to make fivewin accept names of directories from tje user using and also encrypt the exe file generated .
Will I use the run command for each statement or there is another windows way.
Thanks
@echo off 
set limit=1000
set count=0 
set DirName=1 
::set source=F:\etisalat\batches\data
::set newlocation=F:\etisalat\batches\new
::set source=D:\etisalat\data
::set new=D:\etisalat\new

@cls

echo.
echo.
set /p source="Source directory of Input                   :"
set /p newlocation="Destination directory of Output             :"
set /p limit="Number of files in each directory           :"
set /p sortchr="Select files starting with certain character:"



if not exist "%newlocation%" md "%newlocation%"

setlocal enabledelayedexpansion 
echo %source%

dir /b "%source%\%sortchr%*.*" | sort /+1 > %newlocation%\dir.txt

echo Moving files from "%Source%" to "%newlocation%\%DirName%" 
for /F "tokens=*" %%* in (%newlocation%\dir.txt) do ( 
        if not exist "%Source%\!DirName!" md "%newlocation%\!DirName!"
        move "%Source%\%%*" "%newlocation%\!DirName!" 
::        if not exist "%Source%\!DirName!" echo md "%newlocation%\!DirName!"
::        echo move "%Source%\%%*" "%newlocation%\!DirName!" 

	set /a count=!count! + 1 
	if !count! GEQ %limit% ( 
		set count=0 
		set /a DirName=!DirName! + 1 
	)
)
echo Moving files from "%Source%" to "%newlocation%\!DirName!" 
::del %newlocation%\dir.txt
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Visual batch file using fivewin

Posted: Mon Sep 08, 2008 11:02 PM

Ehab,

You can use CopyFile( cExistingFileName, cNewFileName, lFailIfExists ) --> lSuccess

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM

Visual batch file using fivewin

Posted: Tue Sep 09, 2008 05:57 AM

What about visual functions of prompting the user to accept some variables from the screen like name of directory , number of files (limit variable)....etc

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Visual batch file using fivewin

Posted: Tue Sep 09, 2008 08:39 AM

You have to code it yourself.

As far as we know, Windows does not provide such dialogbox.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion