SFX script problem..

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

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

SFX script problem..

#1 Post by Dos_Probie » 11 Aug 2012 18:20

I have the below script that creates the diskpart .txt file and .bat to create a Bootable USB thumbdrive and works great,
but when I create a sfx winrar .exe file its not creating the the script.txt or bat file.
I am open to suggestions.. thanks, DosProbie

Code: Select all

@echo off&color a
setlocal EnableDelayedExpansion
title WINDOWS 7 USB BOOTABLE OS TOOL

echo NOTE: Insert Your USB Thumbdrive and DVD then press any [KEY] to Begin...&&PAUSE>NUL
cls
title CREATE DISKPART SCRIPT AND INSTALLER BAT FILE
echo IMPORTANT: Make A Note of USB Disk#, and USB-DVD Drive Letters...
echo.
echo Then [Exit] out of Disk Management to Begin...
echo.
diskmgmt.msc
echo Did you get the USB Disk# and USB-DVD Drive Letters?
echo If So..Press Any [KEY] to Continue...&&PAUSE>NUL
cls
::==SET %VARIABLE% VALUES==::
set /p Disk=Please Enter USB Disk#:
if "%Disk%"=="" goto :eof
echo.
set /p USB=Please Enter USB Disk Letter:
if "%USB%"=="" goto :eof
echo.
set /p DVD=Please Enter CD-ROM/DVD Disk Letter:
if "%DVD%"=="" goto :eof
echo.
::==CREATE DISKPART SCRIPT FILE==::
echo>>Script.txt Select Disk %disk%
echo>>Script.txt Clean
echo>>Script.txt Create Partition Primary
echo>>Script.txt Select Partition 1
echo>>Script.txt Active
echo>>Script.txt Format FS=ntfs
echo>>Script.txt Assign letter=%usb% noerr
echo>>Script.txt End
::==============================================+
::==CREATE INSTALLER BATCH SCRIPT==::
echo> USB.Format.Tool.bat @echo off
echo>>USB.Format.Tool.bat color e
echo>>USB.Format.Tool.bat title W7 Bootable USB
echo>>USB.Format.Tool.bat DiskPart.exe /s Script.txt
echo>>USB.Format.Tool.bat echo.
echo>>USB.Format.Tool.bat echo.
echo>>USB.Format.Tool.bat echo +=================================================+
echo>>USB.Format.Tool.bat echo +      Creating a Bootable USB Flash Drive.       +
echo>>USB.Format.Tool.bat echo +=================================================+
echo>>USB.Format.Tool.bat echo.
echo>>USB.Format.Tool.bat xcopy %dvd%:\*.*  %usb%:\ /s/e/h/f/c/q
echo>>USB.Format.Tool.bat echo.
echo>>USB.Format.Tool.bat echo.
echo>>USB.Format.Tool.bat cls
echo>>USB.Format.Tool.bat echo Your Thumbdrive OS Completed Successfully...
echo>>USB.Format.Tool.bat echo.
echo>>USB.Format.Tool.bat pause
echo>>USB.Format.Tool.bat exit
::==============================================+
cls
title ALL INSTALL FILES CREATED SUCCESSFULLY
color e
:echo All Files Have Been Created Successfully...
echo You Can Now..Dbl Click on USB.Format.Tool.bat to Install OS to USB...
echo.
echo Press any  [KEY] to Close-Out this Screen...&&PAUSE>NUL
:EOF
Exit
:08-10-12:

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

Re: SFX script problem..

#2 Post by foxidrive » 12 Aug 2012 00:44

You have three tests for conditions where it can skip the file creation, and also the possibility that the files are being created in a location that you don't expect them.

To debug this you can change the three goto :eof to pause, to see if you are dropping out of the bat.


I don't see where winrar is involved...

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

Re: SFX script problem..

#3 Post by Dos_Probie » 12 Aug 2012 11:22

I don't see where winrar is involved


Foxi, I am using Winrar to create a sfx .exe file as I said in my Post...
also as i said the script works great, it creates the files to current or local..
but now I figured out what the issue is and have got it working with the sfx file
basically all that needed to be done was echo> to the desktop per updated code below ...

Code: Select all

::==CREATE DISKPART SCRIPT FILE==::
echo>>%userprofile%\desktop\Script.txt Select Disk %disk%
echo>>%userprofile%\desktop\Script.txt Clean
echo>>%userprofile%\desktop\Script.txt Create Partition Primary
echo>>%userprofile%\desktop\Script.txt Select Partition 1
echo>>%userprofile%\desktop\Script.txt Active
echo>>%userprofile%\desktop\Script.txt Format FS=ntfs
echo>>%userprofile%\desktop\Script.txt Assign letter=%usb% noerr
echo>>%userprofile%\desktop\Script.txt End
::==============================================+
::==CREATE INSTALLER BATCH SCRIPT==::
echo>>%userprofile%\desktop\USB.Format.Tool.bat @echo off
echo>>%userprofile%\desktop\USB.Format.Tool.bat color e
echo>>%userprofile%\desktop\USB.Format.Tool.bat title W7 Bootable USB
echo>>%userprofile%\desktop\USB.Format.Tool.bat DiskPart.exe /s Script.txt
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo.
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo.
echo>>%userprofile%\desktop\%userprofile%\desktop\USB.Format.Tool.bat echo +=================================================+
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo +      Creating a Bootable USB Flash Drive.       +
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo +=================================================+
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo.
echo>>%userprofile%\desktop\USB.Format.Tool.bat xcopy %dvd%:\*.*  %usb%:\ /s/e/h/f/c/q
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo.
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo.
echo>>%userprofile%\desktop\USB.Format.Tool.bat cls
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo Your Thumbdrive OS Completed Successfully...
echo>>%userprofile%\desktop\USB.Format.Tool.bat echo.
echo>>%userprofile%\desktop\USB.Format.Tool.bat pause
echo>>%userprofile%\desktop\USB.Format.Tool.bat exit
::==============================================+

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

Re: SFX script problem..

#4 Post by foxidrive » 12 Aug 2012 16:38

foxidrive wrote:the possibility that the files are being created in a location that you don't expect them.


So, this was the issue.

Post Reply