== Sfx Batch Issue? ==

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

== Sfx Batch Issue? ==

#1 Post by Dos_Probie » 11 Dec 2012 22:49

Does anyone on here have experience with sfx package files??
when I run the below script from the desktop it copies everything over but once packed to sfx
I get "File not found - VLC Media Player" I know I created the sfx correctly because
the games files within sfx copy over but when going outside and trying to copy from program files
then that's when I get the error..I tried doing a set Pathname=%programfiles% and pushd %Pathname%
etc. but still same error. Thanks for any help on this, driving me crazy.. :|

Code: Select all

@echo off
:: Copy from program files..
xcopy /Y /I "%programfiles%\VLC Media Player\VLC Media Player" "%ProgramData%\Microsoft\Windows\Start Menu\Programs\VLC Media Player\">nul
:: Copy from games folder..
xcopy /Y "games\Games Explorer.lnk" "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Games\">nul
exit

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: == Sfx Batch Issue? ==

#2 Post by foxidrive » 12 Dec 2012 00:51

sfx is a self-extracting archive, right?

Try extracting the file and examine the location to see if vlc is there.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: == Sfx Batch Issue? ==

#3 Post by Dos_Probie » 12 Dec 2012 05:38

Thanks for the reply Foxi, Yes the path is correct..
Here is a link to someone else having same problem: http://sourceforge.net/p/sevenzip/discu ... d/e8eab57d

Just to test out my issue I created 2 test batch files..(see below)
1. test.bat (placed in system32 directory)
2. desktop.cmd (placed on the desktop that calls up the test.bat)
3. Before I made the desktop.cmd a sfx file I ran it and it worked correctly, calling up my test.bat
4. Then I created sfx file from desktop.cmd but get 'Windows cannot find "C:\Windows\System32\test.bat'..blah,blah
Been making sfx files for years so I know its correct, but if anyone knows how to created a sfx file
you could do the same and test out then you would understand..

Code: Select all

@echo off
::test.bat(in system32)
Echo TESTing..TESTing..1, 2 and 3..
echo.
echo.
pause

@echo off
::desktop.cmd(from desktop)

set Pathname="%systemroot%\System32"
cd /d %Pathname%
start "" %Pathname%\test.bat
exit

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: == Sfx Batch Issue? ==

#4 Post by abc0502 » 12 Dec 2012 05:50

just to understand, the sfx file is extracting the desktop.cmd and run it, and that call the test.bat ?

BTW, is this just a mistake or ...
check the double quotes
set Pathname="%systemroot%\System32"

maybe you should make it that way
set "Pathname=%systemroot%\System32"

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: == Sfx Batch Issue? ==

#5 Post by foxidrive » 12 Dec 2012 06:04

The key information which we don't have is: when the SFX is extracted, where does it go...

I know that SFX files come in different types - some ask for a location to extract in, some extract to the current folder, and your batch file is showing "File not found" which means that the files are NOT in the location the batch file expects them to be.

If you need help then upload an sfx and the bat file somewhere where we can access them, to test it for you.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: == Sfx Batch Issue? ==

#6 Post by Dos_Probie » 12 Dec 2012 07:25

foxidrive wrote:The key information which we don't have is: when the SFX is extracted, where does it go...

I know that SFX files come in different types - some ask for a location to extract in, some extract to the current folder, and your batch file is showing "File not found" which means that the files are NOT in the location the batch file expects them to be.

If you need help then upload an sfx and the bat file somewhere where we can access them, to test it for you.


Great suggestion Foxi..
the sfx or rather batch goes to the temp folder and I tried with quotes both ways but doesn't seem to make a difference. My brain is all mush right now working on this and I have a few service calls that I need to go out on, but when I get back I will upload everything and post the link..
btw did you create the bat and cmd file and see that that is working?

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: == Sfx Batch Issue? ==

#7 Post by abc0502 » 12 Dec 2012 11:34

From what i can see, the problem must be in the sfx, when you create the file you set the path where it will be extracted you must have made something wrong at this point.

BTW, there is an option to make the sfx file extract the content in temp directory maybe that is related

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: == Sfx Batch Issue? ==

#8 Post by foxidrive » 12 Dec 2012 12:22

Dos_Probie wrote:btw did you create the bat and cmd file and see that that is working?


I did, and it asks for administrator permissions to copy to system32, but the batch file works there fine.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: == Sfx Batch Issue? ==

#9 Post by abc0502 » 12 Dec 2012 12:30

why using CD /d maybe if you just use the full location between double quotes in the start command directly, some times windows become unstable like what happened with aaksar in the FTP batch he requested.
we spent a lot of time and the problem was the batch refused to run or use any file that exist in the same directory without providing the full location pointing to these files and it was working with me fine as long as the files is in the same folder with the batch.
it was working ok in the first 1 or 2 batches with him then it stopped :? :?:

it just happens :? .

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: == Sfx Batch Issue? ==

#10 Post by Dos_Probie » 12 Dec 2012 13:43

Foxi, It asks for administrator permissions to copy because you have UAC set to notifiy, if
you set to never notify the permissions will go away. ABC it is set to extract to the
temp folder as I stated to Foxi, If I include the files in the same folder with the batch
then make it self extracting or sfx it reads correctly off of those, but if I don't
include the files but direct the batch to read off of the system32, Windows or C: drive
then it gives me the error that it cant find file etc. So I think the real issue has
something to do the with the absolute and relative path..The easy fix is just to include
everything in one folder with the batch but sometimes that is just not the most efficient
way since the file/s or already located on my hard drive and also it can create one huge sfx file.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: == Sfx Batch Issue? ==

#11 Post by foxidrive » 12 Dec 2012 14:23

Dos_Probie wrote:Foxi, It asks for administrator permissions to copy because you have UAC set to notifiy, if
you set to never notify the permissions will go away.


I do actually have UAC set to Never Notify in Win 8.
Is this file you are creating for your personal use? I assumed it was for other people too, so you would have to deal with UAC.

Why are you extracting it to system32? Why not extract to %temp% ?
I suspect your batch file is in error but you haven't shown us the code...

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: == Sfx Batch Issue? ==

#12 Post by Dos_Probie » 12 Dec 2012 15:38

On puter will Dell right now ... so when I get done will upload everything..
but yes for me and customers with Win8 , you must not be on as Admin if you
have permissions nag, I use autounattend.xml file that automatically sets user
as Administrator and then then do takedown and icacls so never have that issue, anyway long and short when I set up my Distribution folders $OEM$ you don't have option for temp so I put some of my installs to the system32 then remove or delete at first logon ..

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: == Sfx Batch Issue? ==

#13 Post by foxidrive » 12 Dec 2012 17:54

Dos_Probie wrote:you must not be on as Admin if you have permissions nag


I am certainly logged in as admin. It's the only account on the box.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: == Sfx Batch Issue? ==

#14 Post by Dos_Probie » 12 Dec 2012 21:16

Ok, here is the link (good til 19th) of a sfx Copy example with apps to the start-menu..Thanks for the help! :P
https://www.yousendit.com/download/WUJi ... MEhtcXNUQw

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: == Sfx Batch Issue? ==

#15 Post by abc0502 » 12 Dec 2012 23:27

I didn't test it live as i'm using xp now, but in the run.cmd file:
::Change Directory (required for sfx to work)
set Pathname=%programfiles%
pushd %Pathname%
xcopy /Y /I "%Pathname%\pocket radio player\startmenu\*.*" "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Pocket Radio\">nul
You already pushed the %pathname%, why then using it when you use xcopy, you already in that directory. maybe this is it.
it should be "pocket radio player\startmenu\*.*"
Also, add double quotes around "Pathname=%programfiles%" because the spaces in the directory names might cause you some errors

You did that in your test batch too:
set Pathname="%systemroot%\System32"
cd /d %Pathname%
start "" %Pathname%\test.bat
exit
it should be "test.bat"

Post Reply