MSFN Forum: bat2exe not work win x64? - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

bat2exe not work win x64? Rate Topic: -----

#1 User is offline   MgmTest 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 13-January 12
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 18 September 2012 - 12:52 AM

Me Need Help For bat2exe but not working for delete files in win x64.
test in win x 86 working.

@echo off
echo.
cls
del "%ProgramFiles%\test\azqq\ Sample Image.png"
erase /q /a /s "%ProgramFiles%\test\azqq\Sample Image.png"
echo.
exit



#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,682
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 18 September 2012 - 09:02 AM

Which version of Windows?

Try putting your folder someplace other than Program Files, since on more recent OSes, that is a protected location.

#3 User is offline   MgmTest 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 13-January 12
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 28 October 2012 - 02:26 AM

erase /q /a /s "%ProgramFiles%\Test\Test E ff\Support Files\Plug-ins\Effects\Synthetic Aperture\(CF3 Support)\Preset Sample Image.png"

I did everything but still this file in the mentioned address doesn't getting deleted in windows x64. what else should I do?

#4 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,244
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 28 October 2012 - 10:00 AM

View PostMgmTest, on 28 October 2012 - 02:26 AM, said:

erase /q /a /s "%ProgramFiles%\Test\Test E ff\Support Files\Plug-ins\Effects\Synthetic Aperture\(CF3 Support)\Preset Sample Image.png"

I did everything but still this file in the mentioned address doesn't getting deleted in windows x64. what else should I do?

DUH!!!!

View PostTripredacus, on 18 September 2012 - 09:02 AM, said:

Which version of Windows?

Try putting your folder someplace other than Program Files, since on more recent OSes, that is a protected location.

%ProgramFiles% = "Program Files"

1) WHAT is the x64 OS? (XP, Vista, Win7) - name it!
2) Put file in NOT the "Program Files" directory for test!

Repeating the same test will yield the same result. ;)

#5 User is offline   MgmTest 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 13-January 12
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 29 October 2012 - 12:26 AM

1) I am using win 7 x64
2) I've even tried that and I got the same the result. I also tried take ownership and the result was same.

#6 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,736
  • Joined: 13-January 06

Posted 29 October 2012 - 02:27 AM

My 2 cents: it could be that %programfiles% is "C:\Program Files (x86)" when interpreted with bat2exe.
You'll know if you try to echo %programfiles% and pause right after.
Just tried it on windows 2003 x64 and it returns "C:\Program Files (x86)" and it most likely because a 32bit process can't launch a x64 one so environment variables are set in 32bits mode after being launched from 7zipsfx 32bits.
A quick and dirty trick works by replacing the 7zip x86 files with x64 ones (after unpacking bat2exe with 7zip) but upx and the reshacker present with bat2exe doesn't seems to works on x64 that so you don't get the icon and the final file isn't upxed.

This post has been edited by allen2: 29 October 2012 - 03:01 AM


#7 User is online   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,352
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 29 October 2012 - 12:30 PM

Test this on Windows 7 x64 VBS script using Admin Cmd Promt

This image show using %ProgramFiles% varibles as missing and not able to delete the folder
Attached File  ProgramFilesVaribleError1.png (101.07K)
Number of downloads: 14

This image show confirm and deletes folder using %SystemDrive%\Program Files (x86)\ to make the
path to the folder for delete.
Attached File  ProgramFilesVaribleError2.png (162.58K)
Number of downloads: 9

#8 User is offline   MgmTest 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 13-January 12
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 30 October 2012 - 01:11 AM

Line 4 Error:

Posted Image

#9 User is online   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,352
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 30 October 2012 - 11:24 AM

Correct Way
Dim DelPath :DelPath = Act.ExpandEnvironmentStrings



Yours The Wrong way
Dim DelPath :DelPath = Act .ExpandEnvironmentStrings


You have a space where there is suppose to none. That is what your error
is about. The period should be character 28 folowed by the Expand at 29

#10 User is offline   MgmTest 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 13-January 12
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 01 December 2012 - 01:15 AM

Why?

C:\Users\Documents\Delete Software.vbs(4, 55) Microsoft VBScript compilation error: Invalid character


***** script completed - exit code: 1 *****


#11 User is online   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,352
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 01 December 2012 - 01:08 PM

Because Wrong
( _"%sys



Correct
("%sys



Underscore is used to split a long line of code and continue on the lower line.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy