Link to home
Start Free TrialLog in
Avatar of cpatte7372
cpatte7372Flag for United Kingdom of Great Britain and Northern Ireland

asked on

How To Create BATCH file from an EXE file

Hello Experts,

I've getting support from Solarwinds on how to Execute an external program from an executable file, see
https://thwack.solarwinds.com/message/243299?et=watches.email.thread#243299

I have been told to create a bat file from my exe, however I don't know how to create a batch file from an exe.

Can someone please show me.

Regards

Carlton
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cpatte7372

ASKER

duncanb7

Going to try your suggestion now....

Cheers
duncanb

I created the following bat file as you suggested but didn't work.

@echo off
:Start
"c:\program files (x86)\microsoft office\office12\excel.exe" C:\Users\Pattec01\Documents\theone.xls

When I run it I get the message:

'■@'

Not recognised..
Avatar of duncanb7
duncanb7

just example, since you might not have excel.exe at that directory,

try your own  example such as notepad

@echo off
:Start
notepad.exe
this sounds like the file is saved "unicode", and should be saved "ascii" or vice-versa
when you do a save as, please check which encoding you put.

this said, I have already seen a couple of times that notepad may put a "strange" character in the beginning of the file, in which case you need to use another editor (ultraedit, notepad++, just to name the ones used here ...)
Hi Guy,

The options I have are:

ANSI
Unicode
Unicode big endian
UTF-8

I don't have the ascii format.

Regards
Chaps,

I managed to create a bat file with the following:

"C:\Program Files\VanDyke Software\SecureCRT\SecureCRT.exe" /Script C:\temp\Script.vbs

I saved the file with Unicode. However, it won't execute in the program from the link I showed you above.

Guy, are you suggesting this still needs to be save in ascii? Even though I can get it to work from cmd prompt?

Cheers
could you try this first without  vps file ?

"C:\Program Files\VanDyke Software\SecureCRT\SecureCRT.exe"
sorry, ANSI , not ASCII...
what I suggest alternatively is to use another text file editor
duncan,

Going to try now...

Guy, no worries mate.
I can get the batch file to work.

However, I can't get it to work with the program in Solarwinds.....
Thank you