Visual batch file using fivewin

Visual batch file using fivewin

Postby Ehab Samir Aziz » 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
Code: Select all  Expand view



@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
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Antonio Linares » Mon Sep 08, 2008 11:02 pm

Ehab,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ehab Samir Aziz » Tue Sep 09, 2008 5: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
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Antonio Linares » Tue Sep 09, 2008 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 74 guests