Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
setting a parameter through shell
Yzöwl replied to sweept's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
The important bit for you will be this line: strCommand = "%COMSPEC% /c Reg add ""HKCU\Software\Microsoft\Internet Explorer\Main"" /v ""Start Page"" /d " & chr(34) & strHome & chr(34) & " /f"You would be running a command with the input parameter, (strHome) strCommand = "YourChosenCommand " & chr(34) & strHome & chr(34) -
setting a parameter through shell
Yzöwl replied to sweept's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Try to copy and paste it again! because from your error there aren't that many characters on line 1. -
setting a parameter through shell
Yzöwl replied to sweept's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Something like this vbscript perhaps. Set objShell = CreateObject("Wscript.Shell")strHome = InputBox("Provide your chosen Homepage:", "Homepage", "http://www.google.com/")If strHome = "" Then WScript.Echo "User input cancelled!" Wscript.QuitEnd IfstrCommand = "%COMSPEC% /c Reg add ""HKCU\Software\Microsoft\Internet Explorer\Main"" /v ""Start Page"" /d " & chr(34) & strHome & chr(34) & " /f"objShell.Run strCommand -
{REQ}Install .NETFramework 2
Yzöwl replied to MgmTest's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
You shouldn't need a v3.5 executable, .NET Framework version 3.5 is already included with Windows 8, it is an optional component. As for detecting the version, have you read this? -
{REQ}Install .NETFramework 2
Yzöwl replied to MgmTest's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
The Microsoft recommended registry key method is to check: Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727 Value: Install, Type: REG_DWORD, Data: 1 -
Problems using %ERRORLEVEL%
Yzöwl replied to Rez.'s topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Please try to expand upon your intentions because they currently appear incomplete or confused. I would suggest that those two values would return only a 1 or a 0, if you have set them both previously to their non default value then that should be all you need to check. That said, even if they are already set to their non-default values, where would the harm be in forcing that data again? As a side note please bear in mind that changes to this key, especially if part of an unattended setup will not generally take effect unless run at first logon or later. Also depending upon your Operating System, different versions of reg.exe have different features. The following example would work from Vista but not in Windows XP: @ECHO OFFSETLOCAL(SET RKEY=HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\ADVANCED)(SET VALS=HideIcons SharingWizardOn)FOR %%A IN (%VALS%) DO ( REG QUERY %RKEY% /F %%A /V /E >NUL 2>&1 &&(ECHO=%%A EXISTS)||( ECHO=%%A NOT FOUND))PAUSE -
Here's an idea. REM ###########################REM #Navigate to EDI directory#REM #If it doesn't exist or if#REM #it has no contents-bypass#REM ###########################PUSHD F:\EDIout 2>NUL && (DIR/B/S/A|FIND "\">NUL ||GOTO comms)||(GOTO comms)REM #############################################REM #Set directory name based upon date and time#REM #############################################FOR /F "TOKENS=1-7 DELIMS=/:. " %%A IN ("%DATE%%TIME%") DO ( SET destDir=%%C-%%B-%%A_%%D.%%E.%%F.%%G)REM ###########################REM #Copy files to new archive#REM ###########################XCOPY *.* "Archive\%destDir%" /S /C /I /Q /H /K:commsREM ###########################REM ## Comms stuff goes next ##REM ###########################
-
Echoing Unicode in batch scripts?
Yzöwl replied to tomasz86's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
There may be a way to output it from a script but it would be very specific and not generic. it would very likely that the method would not be easily transferrable in a different scenario later -
The most obvious suggestion is not to turn echoing off and to pause the script at the end. If you are relatively new to NT Command Scripts then you may be better advised to post the code here, either as an attachment or within code tags, upon your reply.
-
How can I move groups of files from a folder with nearly 50,000 files
Yzöwl replied to bizzybody's topic in Software Hangout
I'm not expecting this batch to be particularly quick but it may suit your needs: @ECHO OFFSETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSIONSET "SRC=X:\MY SOURCE"SET "DEST=X:\MY DESTINATION"SET/A "CHUNK=1000"SET/A "COUNT=0"FOR /F "TOKENS=*" %%# IN ('DIR/B/A-D "%SRC%"') DO ( ECHO=MOVE "%%#" "%DEST%" SET/A "COUNT+=1" SET/A "MOD=COUNT %% CHUNK" IF !MOD! EQU 0 GOTO OUTPUT):OUTPUTECHO= %COUNT% FILES MOVED FROM %SRC% TO %DEST%PAUSEEXITJust in case you're interested something like this Powershell one liner may suit: Get-Childitem "X:\MY SOURCE" | Select-Object -First 1000 | Move-Item "X:\MY DESTINATION" -
So this is the script I should use? What about the exe files? If you'd looked a little harder you'd have also noticed an example script for .EXE files too! All that was needed was to join them into one, perhaps something like this UnTested: Example for recursion: @ECHO OFFSETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSIONFOR /R "%~dp0" %%A IN (*-KB*.*) DO ( IF /I %%~xA==.MSU (SET _=WUSA) ELSE ( IF /I NOT %%~xA==.EXE GOTO :EOF SET "_=") CALL :SUB "%%~nA" >NUL TIMEOUT /t 3 %_% "%%A" /quiet /norestart)ECHO= == Press any key to restart ==>NUL PAUSESHUTDOWN /rGOTO :EOF:SUB SET "KB_NUM=%*" FOR /F "DELIMS=-" %%B IN ("%KB_NUM:*-KB=%") DO ( ECHO= Installing KB%%B)Example for all in same directory: @ECHO OFFSETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSIONPUSHD %~dp0FOR %%A IN (*-KB*.*) DO ( IF /I %%~xA==.MSU (SET _=WUSA) ELSE ( IF /I NOT %%~xA==.EXE GOTO :EOF SET "_=") CALL :SUB %%~nA >NUL TIMEOUT /t 3 %_% "%%~fA" /quiet /norestart)ECHO= == Press any key to restart ==>NUL PAUSESHUTDOWN /rGOTO :EOF:SUB SET "KB_NUM=%*" FOR /F "DELIMS=-" %%B IN ("%KB_NUM:*-KB=%") DO ( ECHO= Installing KB%%B)
-
You can use it like that if your reg files are actually part of the running Operating System otherwise the %PROGRAMFILES% Environment Variable will not be correct.
-
I think what you are looking for is: @FOR %%A IN ("X:\Program Files\Regimport\*.reg") DO @REGEDIT /S "%%~A"
-
yzowl, for "[a-z]" is it included all character (a-z and 0-9)? I mean if the string started with number? thx in advance for your help It covers members of the alphabet only, I was assuming that your use of \w was for word characters as opposed to numeric, for both you could use both a-z and 0-9 inside the square brackets or alternatively just: findstr/i "\\scripting\\.*" mytext.txteven the double quotes shouldn't be necessary. Or the more simple: findstr/i \\scripting\\ mytext.txtIt just depends what exactly you're trying to match/filter out!
-
ok, but I until you do it, you should remove your content, because I doubt that this forum wants to be connected with warez.MSFN cannot police all sites linked to from their Forum however the direct link to the mediafire executable has been removed. It can still be accessed via the onlinelinkscan page within the original message body.
-
{REQ}Add Registry load file in cdrom
Yzöwl replied to MgmTest's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I would guess that you may wish to escape some characters. REG ADD "HKLM\SOFTWARE\Classes\.apk\shell\install\command" /VE /D "\"%~dp0apps\test\adb.exe\" install -r \"%%1\"" /F -
Good luck with never accidentally invoking one!
-
help: copy file to folder
Yzöwl replied to oneclick's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
First note: We will not respond to homework questions. Secondly, this is a programming Forum and you haven't told us what the base OS is nor which language you require for your solution; you have not provided real names for the files/folders/locations and failure to rectify these will result in me closing this Topic. -
Which filenames are drivers? Where should I put them?
Yzöwl replied to McGyver's topic in Device Drivers
There's nothing at all wrong with the installer, the problem is that you have a corrupted download. It's an all in one installer, the contents are for more than one printer, and include tools and utilities too so trying to work out which are yours from a bad download is pointless. Try downloading it again by clicking here! -
What happens if you replace ControlSet001 with CurrentControlSet
-
Please note that nobody modified the content of your log. Perhaps the issue was the amount of information you decided to include within the message body. The necessary modification I made to your post was a straight cut and paste of 1570 lines of screen real eastate into a text file attachment, (everything I cut was pasted).
-
It is my understanding that imagex does not produce in process stdout for redirection, it only flushes it at the end. You may need to look at using an alternative such as RTconsole.