Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Batch - execute epstopdf for all *.eps within folder

Featured Replies

Hey there!

A question from me as a newbie in batch-programming :huh: :

I would like to program a batch-file which executes epstopdf.exe for every *.eps in the folder, where the batch-file is located.

A friend told me to use the following command-line interface (which does work pretty well, but is sometimes quite cumbersome):

for %i in (*.eps) do epstopdf %i

I'm sure someone can help me :)

Thanks in advance!

A friend told me to use the following command-line interface (which does work pretty well, but is sometimes quite cumbersome):

for %i in (*.eps) do epstopdf %i

I'm sure someone can help me :)

Yep, at it's vey basic you need to:

  1. make sure that the "right directory" is chosen
  2. make sure that the epstopdf.exe program is found
  3. translate that one-liner in a batch (basically doubling the % in the FOR loop variable

Basically:

@ECHO OFF
CD /D %~dp0
SET Program="C:\My program directory\eps to pdf\epstopdf.exe"
for %%A in (*.eps) do %Program% %%A

this assumes that you copy the small batch to the directory and that you have the program in a "fixed" directory, in the example "C:\My program directory\eps to pdf\epstopdf.exe".

The %~dp0 will expand to the drive and path of the item 0 of the command line (the batch file itself).

jaclaz

Edited by jaclaz

  • Author

@jaclaz: Amazing how fast you have given me this answer! :thumbup

Thank you very much for the great explanation.

I'll try it immediately!

cirrocumulus

@ECHO OFF
CD /D %~dp0
SET Program="C:\My program directory\eps to pdf\epstopdf.exe"
for %%A in (*.eps) do %Program% %%A

this assumes that you copy the small batch to the directory and that you have the program in a "fixed" directory, in the example "C:\My program directory\eps to pdf\epstopdf.exe".

The %~dp0 will expand to the drive and path of the item 0 of the command line (the batch file itself).

Since there always is room for improvement, let me please suggest one:

@ECHO OFF
PUSHD %~dp0
SET Program="C:\My program directory\eps to pdf\epstopdf.exe"
for %%A in (*.eps) do %Program% %%A
POPD

The pair PUSHD/POPD saves the current drive:\directory, before changing to the new one, then returns to it, respectively.

So, at the end, you'll be back to the folder you started in.

This is a VBS Script that will find EPS files anywhere on the Computer that this script

run from. Fill in the App = Chr(34) & "PATH_TO_APPLICATION_HERE" & Chr(34)

with the correct path to the app. The Chr(34) = ", so the app path will be in double quotes


Dim Act :Set Act = CreateObject("Wscript.Shell")
Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Wmi :Set Wmi = GetObject("winmgmts:\\.\root\cimv2")
Dim App, Col, Obj
App = Chr(34) & "PATH_TO_APPLICATION_HERE" & Chr(34)
Set Col = Wmi.ExecQuery _
("Select * from CIM_DataFile Where Extension = 'eps'")
'-> If No File Is Found
If Col.count = 0 Then
Act.Popup "Can Not Find This File Type : eps",5,"No File Found",4128
Else
For Each Obj In Col
'-> Run Only If App Exists
If Fso.FileExists(App) Then Act.Run(App & Obj.Name),1,True
Next
End If

  • Author

@dencorso & gunsmokingman:

Thanks for the additional informations!

I see, I'll have to learn a bit vbs- and batch-programming. Sometimes it seems to be really useful :)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.