1.

Solve : [solved] Create 100 files in a folder?

Answer» QUOTE from: BC_Programmer on August 22, 2009, 12:18:56 PM
I'm trying to understand why multiple batch files are even necessary.

Is for my program Goldmine 5.5 from Frontrange.

This program make macros with the structure user.800 .... user.899

When I launch from the exterior a user.800.bat ...... user.899.bat I'm launching the program with my parameters and a specified macro.

In this way

user.860.bat launch

echo off
taskkill.exe /im gmw5.exe /f
Y:\GoldminePrg\gmw5.exe /i:esm /U:JOSE /p: /m:Y:\GoldminePrg\Macros\user.860
exit

P.D. Each macro goes o search for a certain field in the database. So is equivalent to enter Goldmine and go to the field determined by the interior macro.....

I hope is understood.

Thanksxxxx

Quote from: BC_Programmer on August 22, 2009, 12:18:56 PM
I'm trying to understand why multiple batch files are even necessary.

Well.
I use excel 2002 and have a check list. I would like to link this list with certain contacts in the database.
Each bat is used to link to a contact predetermined with a INTERNAL goldmine macro.

In an excel cell I put the PATH to the bat : \pepe.800.bat

Each bat EXECUTE the program goldmine and a internal macro , and goes to a predetermined contact in the database. And edit that contact.

I hope this is understood.

I have to make one internal macro for each contact to search.

And one corresponding bat for each internal macro.

The internal macro have the structure pepe.800
and the bats have the structure pepe.800.bat

....



Quote from: BatchFileBasics on August 22, 2009, 12:25:01 PM
Esgrimidor, what do you need 100 batch files for anyways? 1 file, about 10 lines, and a good for loop can probably do what all these files would do..

and really, this is confusing me,
here you go
Code: [Select]@echo off
:begin
set pth=
echo.
set /p pth=Path of folder:
if not exist "%pth%" (
mkdir "%pth%"
goto :PRE
)
echo.
echo ERROR: Folder exists
goto :begin
:PRE
set /p pr=Prefix for files:
echo.
echo IF THE PREFIX CONTAINS INVALID CHARACTERS, FILES WOULD NOT BE CREATED.
pause
cd /d "%pth%"
for /l %%a in (800,1,899) do (
echo @echo off>%pr%.%%a.bat
echo taskkill.exe /im gmw5.exe /f>>%pr%.%%a.bat
echo Y:\GoldminePrg\gmw5.exe /i:esm /u:JOSE /p: /m:Y:\GoldminePrg\Macros\%pr%.%%a >>%pr%.%%a.bat
echo exit>>%pr%.%%a.bat
)


Please tell me if this modification is correct or not :

Code: [Select]@echo off
:begin
set pth=
echo.
set /p pth=Path of folder:
if not exist "%pth%" (
mkdir "%pth%"
goto :PRE
)
echo.
echo ERROR: Folder exists
goto :begin
:PRE
set /p pr=Prefix for files:
echo.
echo IF THE PREFIX CONTAINS INVALID CHARACTERS, FILES WOULD NOT BE CREATED.
pause
cd /d "%pth%"
for /l %%a in (800,1,899) do (
echo @echo off>%pr%.%%a
echo taskkill.exe /im gmw5.exe /f>>%pr%.%%a
echo Y:\GoldminePrg\gmw5.exe /i:esm /u:JOSE /p: /m:Y:\GoldminePrg\Macros\%pr%.%%a >>%pr%.%%a
echo exit>>%pr%.%%a
)sorry, i mean the extensions it is being output to is not in bat

following your..."requests"

this is it:
Code: [Select]@echo off
:begin
set pth=
echo.
set /p pth=Path of folder:
if not exist "%pth%" (
mkdir "%pth%"
goto :PRE
)
echo.
echo ERROR: Folder exists
goto :begin
:PRE
set /p pr=Prefix for files:
echo.
echo IF THE PREFIX CONTAINS INVALID CHARACTERS, FILES WOULD NOT BE CREATED.
pause
cd /d "%pth%"
for /l %%a in (800,1,899) do (
echo @echo off>%pr%.%%a.bat
echo taskkill.exe /im gmw5.exe /f>>%pr%.%%a.bat
echo Y:\GoldminePrg\gmw5.exe /i:esm /u:JOSE /p: /m:Y:\GoldminePrg\Macros\%pr%.%%a >>%pr%.%%a.bat
echo exit>>%pr%.%%a.bat
)Of course you are right

Sure there are a lots of ways of doing this : DDE, API Goldmine, COM procedures, etc.
But in the goldmine forum , at the present moment, they don't give support for via VB create an script for seek a record in the database without need to open goldmine.

This way is one of many ways, and for me is enough.

Thank very much.

100 is the number of macros you can create with a user. Each user can have 100 macros. And the user JOSE can use the macros of other users......

In this way I can have all the links I need from excel, word.

To make "fussions" Goldmine have an utility : gmlinks I use to prepared personalyzed writes....













Quote from: BatchFileBasics on August 22, 2009, 12:41:24 PM
sorry, i mean the extensions it is being output to is not in bat

following your..."requests"

this is it:
Code: [Select]@echo off
:begin
set pth=
echo.
set /p pth=Path of folder:
if not exist "%pth%" (
mkdir "%pth%"
goto :PRE
)
echo.
echo ERROR: Folder exists
goto :begin
:PRE
set /p pr=Prefix for files:
echo.
echo IF THE PREFIX CONTAINS INVALID CHARACTERS, FILES WOULD NOT BE CREATED.
pause
cd /d "%pth%"
for /l %%a in (800,1,899) do (
echo @echo off>%pr%.%%a.bat
echo taskkill.exe /im gmw5.exe /f>>%pr%.%%a.bat
echo Y:\GoldminePrg\gmw5.exe /i:esm /u:JOSE /p: /m:Y:\GoldminePrg\Macros\%pr%.%%a >>%pr%.%%a.bat
echo exit>>%pr%.%%a.bat
)



I see.....

How can I do bat files pepe.800.bat and inside the bat : pepe.800 only ?

thats what it is, they are all .bat files.
but inside are just pre.800
no .bat insideOh yes.

Perfect. Is enough for me.
You have saved me a lot of work.
With the bats is another thing....

Code: [Select]@echo off
set /p prefix=Enter Prefix:
for %%d in (0, 1, 100) do (
set /A i=%%d+800
taskkill.exe /im gmw5.exe /f
Y:\GoldminePrg\gmw5.exe /i:esm /u:JOSE /p: /m:Y:\GoldminePrg\Macros\%%prefix.%%i.bat
)
exit


Discussion

No Comment Found