Caml Light
Content Type
Profiles
Forums
Events
Posts posted by Caml Light
-
-
ok... i'll try to explain better:
Imagine to have a CMD shell window already opened. Is it possible to pass it some commands, not writing them into that shell but from WIN+R?
0 -
Yes, that works launching a single instance of cmd.exe. But does exists a way to do exactly what i wrote?
0 -
Hi guys, if i do this:
WIN+R -> cmd /k echo Hello -> ENTER
WIN+R -> cmd /k echo World -> ENTER
I'll have 2 different CMD shell windows: the first displays "Hello", while the second "World".
Do you know if is it possible to launch the second command in the same CMD shell window of the first one, to have:
Hello
World
_Thank you in advance
0 -
Yzöwl i've an idea! Could it to be possible to obfuscate the content of a batch file?
I can create a compiled exe file from an authoring software, a GUI with a button. Clicking on that button, i can launch the CMD batch file with a specified parameter, for example: mybatch.cmd -param
You wrote for me something like this some months ago:
@ECHO OFF
ECHO=_%~1|FINDSTR/X "_-param">NUL 2>&1||GOTO Error
ECHO Logged succesfully
>NUL PAUSE
EXIT
:Error
ECHO Error
>NUL PAUSE
EXITMy idea is that the batch should recognize the correct parameter given (%~1) and apply it as "algorithm key" to decode the obfuscated batch.
I hope to be explain me fine.
Thank you
0 -
Only the VBScript files can be decompiled without to be extracted. The batch (bat or cmd) files must be extracted in the %TEMP% folder (default) or in a user specified folder.
It will be an honor for me to learn from you and i hope you won't refuse my questions. Thank you.
0 -
Hi bphpt, if you want we can do a game... you ask a question to me and i ask a question to you. Is this a specialist forum or a facebook branch??
Hi Yzöwl, that program decompiles the batch into the HD. Anyway, since you know more things than me in this area and i wish to learn, can i send you some PM if i have need? Please let me know.
To learn, to learn, to learn, always!
0 -
How much are you charging for this script that it would be beneficial for them to steal it. Does Yzowl make a percentage ? For the right price, I will rewrite the entire thing to be encrypted and only decompile in RAM.
CMD batch or converted to a different language?
I'm enthusiast about security, and i want to learn, to learn, to learn, this is the way for me! I'm curious if exists a way to don't decompile in the the HD. I know that is possible to do what you wrote with VBScript, not with a CMD batch.
0 -
I'm confused as to why your non secret updates installation routine being extracted, run and deleted from a default hidden location is considered 'useless'!
Because everyone can access to that folder and get the batch. I wish to hide the batch file. The world is big, not all people are skillful as you or other members of this community.
Anyway, for a UNskillful person, the %TEMP% folder is easy to get.
0 -
Then you need to use the mmb manual to create a mmb script.
i use the program from some years, but i don't know how it could be possible to convert a batch into a MMB script.
EDIT: You've a PM
0 -
I'm using powershell started from cmd.exe via a single line (registry shell extension). How many characters in yours, this one is 498 characters and does not throw me any error.
@ECHO OFF & cmd /k start /b powershell -command "clear-host;[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');$INDEX = [Microsoft.VisualBasic.Interaction]::InputBox('Enter Image #', 'Which image to mount', '1');$PROMPT = [Microsoft.VisualBasic.Interaction]::MsgBox('Ready to mount image ?', 'OKCancel,Question', 'Last Chance to Cancel');switch ($PROMPT) {'OK'{Dism /mount-wim /wimfile:D:\sources\boot.wim /index:$INDEX /mountdir:C:\zMountDir}'Cancel'{exit}}" & PAUSE
On second thought, your script looks short but that %%A variable expands at runtime, the problem could be the expanded 'path' length being more than 256 characters, why not convert the %%A variable to 8.3 short naming before it loops.
Alternatively try encrypting your batch as an exe. Plenty of free-wares offer that agility.
I've already bought (paid version) a well-known batch compiler program, but it extracts the batch into the %TEMP% folder, so it's useless.
Most authoring language uses their own scripting language so maybe you should use it instead of using it to launch batch code.
Anyway if you need the loop part, this might work:
FOR /R %A IN (Windows*-KB*.EXE) DO ( SET _=T && ECHO= Installation of %~nA... && PING -n 4 127.0.0.1 >NUL && "%A" /quiet /norestart)
Do you know Multimedia Builder? I use that program. Anyway, my batch is very long, and with MMB i must create several Run("CMD","parameter$") commands (very bad), so i've choice to do it with a single Run command unifying the whole batch into a single line. But for CMD.exe that line is too long.
0 -
Thank you for your support. Mainly the batch must be read (its content) by a authoring software. Once read, it is saved as variable by the authoring program, than executed as parameter of "CMD.exe". This method works if batch are not too long, because the batch become the parameter of CMD. Is there an alternative way to protect the batch, hiding its content? I also can host the batch on my website, in case of a valid "online protection". I've already bought a specific professional compiler, but during the execution of the compiled EXE, the batch is extracted into the %TEMP% folder, so it is useless.
Thank you
0 -
My batch is based on a old cmd script written by Yzöwl:
@ECHO OFF
ECHO=_%~1|FINDSTR/X "_-123456 _/123456">NUL 2>&1||GOTO Error
SETLOCAL ENABLEEXTENSIONS
SET "_="
PUSHD %~dp0
FOR /R %%A IN (Windows*-KB*.EXE) DO (
SET _=T
ECHO= Installation of %%~nA...
>NUL PING -n 4 127.0.0.1
"%%A" /quiet /norestart)
IF NOT DEFINED _ GOTO Error
ECHO=
ECHO= == Press any key to restart. ==
>NUL PAUSE
SHUTDOWN.EXE /r /t 0
GOTO :EOF
:Error
ECHO= Error.
ECHO=
ECHO= Press any key to exit...
>NUL PAUSEMy batch repeats the central part several times to install other software:
FOR /R %%A IN (Windows*-KB*.EXE) DO (
SET _=T
ECHO= Installation of %%~nA...
>NUL PING -n 4 127.0.0.1
"%%A" /quiet /norestart)Converting it into a single line batch, results too long to execute for CMD.exe. Is there a solution to this limitation?
Thank you
0 -
Hi! My batch file must run on a single line, so i've added the '&' char after every command. Now my batch has not carriage returns. The only problem is that cmd.exe give me the error as from title. Have you suggestions?
Thanks
0 -
i try to understand it, it's not easy for now
Thank you!!
0 -
Exactly! Anyway i also have some MSI files to install. Imagine to do a complete software installation on a PC, starting from all Windows Updates until to the common use applications. What is the easiest way? I'd like to learn VBS, so i hope it's not too difficult to understand.
0 -
Thank you gunsmokingman! I've a question for you. If i wish to add other commands... for example to install other type of files, is it possible?
Example:
Windows Updates:
KB123456
KB234567
KB345678
...
IE9
.NET 4.0
and so on...
With the bath i can do:
FOR /R %%A IN (KB*.EXE) DO (
...
START "" /MIN /WAIT "%%A" /param1)
FOR /R %%A IN (IE9*.EXE) DO (
...
START "" /MIN /WAIT "%%A" /param2)
FOR /R %%A IN (NET*.EXE) DO (
...
START "" /MIN /WAIT "%%A" /param3)You're the guru of VBS, so i hope you can solve my problem.
Thank you for now!
0 -
Hi guys, as from title, i need a complete conversion of one of my batch file. Could you help me please?
@ECHO OFF
ECHO=_%~1|FINDSTR/X "_ _">NUL 2>&1||GOTO Error
SETLOCAL ENABLEEXTENSIONS
SET "_="
PUSHD %~dp0
:: Title
FOR /R %%A IN (file*.EXE) DO (
SET _=T
ECHO=Installation of %%~nA ...>>install.log
>NUL PING -n 4 127.0.0.1
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
START "" /MIN /WAIT REG ADD "HKLM\SOFTWARE\Key" /v "Key" /t REG_DWORD /d 20991231 /f)
IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
START "" /MIN /WAIT REG ADD "HKLM\SOFTWARE\Wow6432Node\Key" /v "Key" /t REG_DWORD /d 20991231 /f)
START "" /MIN /WAIT "%%A" /param)
IF NOT DEFINED _ GOTO Error
ECHO=Installation completed.>>install.log
>NUL PING -n 4 127.0.0.1
EXIT
GOTO :EOF
:Error
ECHO=Install error.>>install.log
>NUL PAUSEThank you in advance for your help!
0 -
Thank you guys!
An other question... how can i convert a CMD batch file with more strings into a batch with a single string?
Could i have an example with this batch:
:loop
rem ping -n 5 localhost
tasklist /fi "IMAGENAME eq process.exe" |findstr /i process.exe
if %errorlevel% eq 0 goto loop else goto :next
:nextThank you!
0 -
Hi guys, i need to loop the taskkill command until the process is killed (this process is hard to kill ). Starting from:
TASKKILL /F /IM process.exe /T
What is the easiest and effective way to do it? Thank you in advance!
0 -
Infact there is no reason to use the RD command running a DVD-R but how could it possible to use both commands (ROBOCOPY and DISM) with the same batch (without RD obviously)? On ss64.com i've read that XCOPY is deprecated with the newer O.S. and we should use ROBOCOPY, but in case of problems i can replace it with the old and simple XCOPY.
If you can, could you write an example of a correct SetupComplete.cmd integrating both ROBOCOPY or XCOPY and DISM please? Thanks
0 -
One question... today i've seen this post: http://forums.mydigitallife.info/threads/28118-Windows-Thin-PC-Addon-Packages?p=489108&viewfull=1#post489108
Using the previous batch, that works perfectly, is it possible to add the SetupComplete.cmd batch from the posted site? Is it correct for you or it should be modified?
Thank you guys
0 -
Yzöwl, thank you!
Cheers
0 -
Hi guys, i need to copy two files from a DVD-R to the %SystemDrive% folder using ROBOCOPY command with a batch file located in the same DVD-R dir of the two files to copy
My problem is that i don't know how specify as source the dir of the batch file...
For now this is my script:
@SETLOCAL ENABLEEXTENSIONS
@CD /D "%~dp0"
ROBOCOPY "???" "%SystemDrive%" file1.ext
ROBOCOPY "???" "%SystemDrive%" file2.extFeel free to fully rewrite my batch. Thank you in advance!
0 -
what to say... it's perfect!
Thank you!!
0
CMD: Pass more commands to a single shell !
in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Posted
Thank you jaclaz, the actual scope of my question is written in the previous posts. My GOAL is exactly it: To pass to an opened cmd shell some commands written from the "Run" prompt.
Alternatively, instead to use the "Run" prompt, i also can use a cmd batch script that send commands to the opened cmd shell. If i run a common batch, it will open a new cmd shell window.