0

ok...Im a new member here and I can express how jolly I am...back to subject

I made a bat file, lets call it 1.bat and I used iexpress to make it an exe file, lets call it 1.exe.

So, in the batch file I added the command line to add a vbs file ( call it 1.vbs ) which is also included in the exe package (1.bat and 1.vbs are in 1.exe) but it installs 1.bat, so in the command I typed:

copy "1.vbs" "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"

If I run the bat file it copies the vbs file to start up, but if I make the 1.exe file in iexpress by including 1.bat and 1.vbs and when I click the 1.exe file, it doesnt work, it doesn't copy the vbs file to startup, it says something about too many parameters.

I'm sorry if my post is too long or my question have been posted before, but I couldn't found any thread solves my issues, if there is, i'd be glad to be enlightened. Thanks.

kstenger
  • 374
  • 1
  • 10
OfvziDon
  • 31
  • 3

3 Answers3

2

Never use "Batch to EXE" converter, they often do not work as expected. Simply use the batch script.

Just a note, this file actually only acts as a wrapper for your script, and the script itself actually gets executed in a temp folder created on execution (and deleted afterwards), so make sure you don't use any relative paths.

source

Community
  • 1
  • 1
Endoro
  • 37,015
  • 8
  • 50
  • 63
0

When running a batch file in IExpress, you need to call it like:

cmd /c 1.bat

If you don’t, variables like %username%, long file names, etc, will likely not work.

fission
  • 1,170
  • 18
  • 35
-1

I suspect you are using short file names. Put in your bat dir then pause and you'll see it's 1~1.vbs or similar.

Serenity
  • 311
  • 2
  • 3