UpGrade Posted September 6, 2015 Share Posted September 6, 2015 Hi guys,I have recently written a batch file for disabling telemetry on windows and want to use it as a setupcomplete.cmd i have tested and it works fine but then when i put it into the %OEM%\Scripts folder it does not run on system install.can anyone that is good with this kind of stuff please take a look! i can send the file to you if you pm me Link to comment Share on other sites More sharing options...
knowledge-Spammer Posted September 6, 2015 Share Posted September 6, 2015 post batch file so people can have a look Link to comment Share on other sites More sharing options...
UpGrade Posted September 6, 2015 Author Share Posted September 6, 2015 post batch file so people can have a lookScript complete with the files it uses is here:http://www67.zippyshare.com/v/CQea0xaN/file.html Password:He110The script uses:Destroy Windows 10 SpyingSpybot Anti-Beacon for Windows 10 v1.2.0.19Disable Windows 7/8/8.1 Telemetry (+Bonus Services) v0.2.8O&O ShutUp10 v1.0.1345Disable Windows 10 TrackingThe script calls on these other programs to disable the telemetry and then sets scheduled tasks to run once each startup and logon to run a script that disables telemetry incase windows installs updates automatically!i didnt code any of the files only the SetupComplete.cmd and Invisible.vbsThe script works completely fine if you run it but when integrated into iso it does not the install just hangs and you have to reboot then when you do script never runs i cant work out why as it works perfectly if run Link to comment Share on other sites More sharing options...
straycat19 Posted September 7, 2015 Share Posted September 7, 2015 Just off the top of my head without looking at your scripts, have you tried copying the files to the drive during the install and then calling them from a temp directory which could be cleaned up after it has finished running? I have run into similar problems in the past and this was an easy fix for me. Link to comment Share on other sites More sharing options...
UpGrade Posted September 7, 2015 Author Share Posted September 7, 2015 Just off the top of my head without looking at your scripts, have you tried copying the files to the drive during the install and then calling them from a temp directory which could be cleaned up after it has finished running? I have run into similar problems in the past and this was an easy fix for me.I was going to try copying them to the harddrive and running but i wanted to post here first incase anyone knows another way or the reason it wont work like this Link to comment Share on other sites More sharing options...
stylemessiah Posted September 7, 2015 Share Posted September 7, 2015 Post the batch, im not the sort of person with limited data who's going to download a 32mb file full of programs to look at a simple batchJust off the top of my head, check your placement path, the batch needs to be in:Sources\$OEM$\$$\Setup\ScriptsIf i could see the batch i could see if any of it has an issue.... Link to comment Share on other sites More sharing options...
UpGrade Posted September 7, 2015 Author Share Posted September 7, 2015 Post the batch, im not the sort of person with limited data who's going to download a 32mb file full of programs to look at a simple batchJust off the top of my head, check your placement path, the batch needs to be in:Sources\$OEM$\$$\Setup\ScriptsIf i could see the batch i could see if any of it has an issue....@ECHO OFFCOLOR 0ASET V=1.0TITLE Windows Telemetry and Data Collection DisablerECHO #########################################################ECHO # #ECHO # WINDOWS 10 Enterprise LTSB Build 10240 X64 #ECHO # Script Version %V% #ECHO # #ECHO #########################################################:REGISTRY TWEAKSREGEDIT /s DarkTheme.regREGEDIT /s TakeOwnership.reg:TELEMETRY SCHEDULED TASK@ECHO OFFXCOPY "DWT" "%SYSTEMROOT%\DWT\" /E /H /S /KSCHTASKS /Create /RU "SYSTEM" /SC ONSTART /TN DisableMicrosoftSpying-Telemetry-1 /TR "'%SYSTEMROOT%\DWT\Invisible.vbs'"SCHTASKS /Create /RU "SYSTEM" /SC ONLOGON /TN DisableMicrosoftSpying-Telemetry-2 /TR "'%SYSTEMROOT%\DWT\Invisible.vbs'":TELEMETRY@ECHO OFFECHO Initialising The Removal of TelemetryECHO ....................../´¯/) ECHO ....................,/¯../ ECHO .................../..../ ECHO ............./´¯/'...'/´¯¯`·¸ ECHO ........../'/.../..../......./¨¯\ ECHO ........('(...´...´.... ¯~/'...') ECHO .........\.................'...../ ECHO ..........''...\.......... _.·´ ECHO ............\..............( ECHO ..............\.............\...ECHO **************************************************************ECHO WARNING: *ECHO BE CAREFULL IF YOU WANT WINDOWS UPDATES DO NOT DISABLE THEM!!*ECHO **************************************************************TIMEOUT 5 ECHO **************************************************************ECHO 1. Now Running: Destroy Windows Spying *ECHO Please Select Options Throughout all Tabs Then *ECHO Press the Button *ECHO **************************************************************START /WAIT DWS.exe ECHO **************************************************************ECHO 2. Now Running: Disable Windows 10 Tracking *ECHO Please Select Options Then *ECHO Press the Get privacy! Button *ECHO **************************************************************START /WAIT DWT.exe ECHO **************************************************************ECHO 3. Now Running: OandO ShutUp10 *ECHO Please Use the Sliders to Turn Options On or Off *ECHO **************************************************************START /WAIT OOS.exe ECHO **************************************************************ECHO 4. Now Running: Spybot Anti-Beacon *ECHO Please Select Options Throughout all Tabs Then *ECHO Apply Immunizations *ECHO **************************************************************START /WAIT SBAB.exe ECHO **************************************************************ECHO WINDOWS TELEMETRY REMOVAL COMPLETE. *ECHO **************************************************************TIMEOUT 5CLS:START MENU INSTALLERTITLE Start Menu InstallerCOLOR 70ECHO #########################################################ECHO # #ECHO # Start Menu Installer #ECHO # #ECHO # #ECHO #########################################################ECHOECHO **************************************ECHO * 1) StartIsBack++ *ECHO * *ECHO * 2) Start10 *ECHO * *ECHO * 3) ClassicShell *ECHO * *ECHO * 4) NONE (Use Windows 10 Default) *ECHO **************************************ECHO Select an Option and Press Enter... set/p "cho=>" if %cho%==1 goto StartIsBackif %cho%==2 goto Start10if %cho%==3 goto ClassicShellif %cho%==4 goto Activationcls:StartIsBack++ECHO Please Use the StartIsBack++ Installer...start /WAIT SIB.exegoto Activation:Start10ECHO Please Use the Start10 Installer...start /WAIT S10.exegoto Activation:ClassicShellECHO Please Use the ClassicShell Installer...start /WAIT CS.exegoto Activation:ACTIVATIONTITLE ActivationCOLOR 1FECHO Starting Windows Activation.TIMEOUT 2CLSECHO ACTIVATING WINDOWSECHO **********************************ECHO * Runing Activation Procedure... *ECHO * Windows May Reboot. *ECHO **********************************pushd "%~dp0"start /wait KMSpico_setup.exe /verysilent /noiconsregedit /s RunOnce.regtimeout /t 120shutdown -r -t 0popdexit Link to comment Share on other sites More sharing options...
UpGrade Posted September 9, 2015 Author Share Posted September 9, 2015 Anyone been able to take a look ? Link to comment Share on other sites More sharing options...
knowledge-Spammer Posted September 9, 2015 Share Posted September 9, 2015 its a nice bit of code u didi tested this script its fine i see u say thisThe script works completely fine if you run it but when integrated into iso it does not the install just hangs and you have to reboot then when you do script never runs i cant work out why as it works perfectly if runhave u tryed to edit the script i say this as when tested i did get something aboutline 5 ? Link to comment Share on other sites More sharing options...
knowledge-Spammer Posted September 9, 2015 Share Posted September 9, 2015 i think its going to take more people to help and test comeon guys plz test and try and help Link to comment Share on other sites More sharing options...
Kakihara73 Posted September 9, 2015 Share Posted September 9, 2015 Hi UpGrade: I love make scripting ^_^ ..I check your script, is very well done. The reason didn't work is one: the script will always run as administrator, so its working directory is always c:\windows\system32 to correct the script you must insert this code if the exe is into the same directory of the script %~dp0\in a nutshell take as example this code of your: START /WAIT DWS.exewill be modify into this: START /WAIT %~dp0\DWS.exesame thing will be apply to reg import ;) hope this help and improve your scripting skills Link to comment Share on other sites More sharing options...
UpGrade Posted September 9, 2015 Author Share Posted September 9, 2015 its a nice bit of code u didi tested this script its fine i see u say thisThe script works completely fine if you run it but when integrated into iso it does not the install just hangs and you have to reboot then when you do script never runs i cant work out why as it works perfectly if runhave u tryed to edit the script i say this as when tested i did get something aboutline 5 ?Thanks for helping! i edited the script so many times changing it to copy files so SYSTEMROOT and then run from there i tried so many things but nothing works!think i changed the script about 6 times and tried different things!Hi UpGrade:I love make scripting ^_^..I check your script, is very well done. The reason didn't work is one:the script will always run as administrator, so its working directory is always c:\windows\system32to correct the script you must insert this code if the exe is into the same directory of the script%~dp0\in a nutshell take as example this code of your:START /WAIT DWS.exewill be modify into this:START /WAIT %~dp0\DWS.exesame thing will be apply to reg import ;)hope this help and improve your scripting skillsThanks it was my first script! Thanks so much for your help i understand the part about %~dp0 but how do i make the working directory c:\windows\system32 ? do i have to make the script copy files there and run another script or just copy files there and run ? Link to comment Share on other sites More sharing options...
Kakihara73 Posted September 9, 2015 Share Posted September 9, 2015 Hi UpGrade: if you understand the %~dp0 then I may know that it refear to path and drive letter itself, so don't need to copy to anywhere your program. however if you want and if you prefer to made a clear and specified path of your scripts, no problem ..remember to specify the real and only one right path ;) Link to comment Share on other sites More sharing options...
UpGrade Posted September 9, 2015 Author Share Posted September 9, 2015 Hi UpGrade:if you understand the %~dp0 then I may know that it refear to path and drive letter itself, so don't need to copy to anywhere your program.however if you want and if you prefer to made a clear and specified path of your scripts, no problem ..remember to specify the real and only one right path ;)yeah i get that the dp is drive path but the path to the setupcomplete.cmd is on the iso on the root of the iso then sources\$OEM$\$$\Setup\Scripts\SetupComplete.cmdso im confused as to how to make it run as c:\windows\system32 unless %~dp0 is what makes it to run in c:\windows\system32 ?i have changed every exe toSTART /WAIT %~dp0\DWS.exeSTART /WAIT %~dp0\DWT.exeand so on and the registry like this#REGEDIT /s %~dp0\DarkTheme.regREGEDIT /s %~dp0\TakeOwnership.regbut now when put into the iso the screen just stays black after setup any ideas ?maby if i putpushd "%~dp0"at the start of the script ? Link to comment Share on other sites More sharing options...
Kakihara73 Posted September 9, 2015 Share Posted September 9, 2015 yes my friend, %~dp0 substitute the entire path where the SetupComplete.cmd is. so it's very strange that don't work mmmm... when something wrong, I disable first echo off to test and view where the script hangs... try to remark 'echo off' too and test where is blocking and if appear some errore message Link to comment Share on other sites More sharing options...
UpGrade Posted September 9, 2015 Author Share Posted September 9, 2015 yes my friend,%~dp0 substitute the entire path where the SetupComplete.cmd is. so it's very strange that don't workmmmm... when something wrong, I disable first echo off to test and view where the script hangs...try to remark 'echo off' too and test where is blocking and if appear some errore messagewell i would try that but i cant even see the batch the screen gets stuck here:Would you edit the code as you would do it please? then i can compare to the changes i have made and see if i did something wrong Link to comment Share on other sites More sharing options...
Kakihara73 Posted September 9, 2015 Share Posted September 9, 2015 @UpGrade: you made changes well, like I will made. I'm sorry for not working and not see some error message -__-" this is a script well done and working: @echo off cd %~dp0 start /wait %~dp0\Fixes\Features.cmd >nul start /wait %~dp0\Apps\ClassicShellSetup64.msi /qn start /wait %windir%\Setup\scripts\Apps\vmware\setup64.exe /S /v"/qn REBOOT=R ADDLOCAL=ALL start /wait %windir%\Setup\scripts\Apps\directx_Jun2010_redist\DXSETUP.EXE /silent schtasks.exe /change /tn "\Microsoft\Windows\Server Manager\ServerManager" /disable copy Fixes.cmd "%programdata%\Microsoft\Windows\Start Menu\Programs\StartUp\Fixes.cmd" sc config AudioSrv start= auto sc config AudioEndpointBuilder start= auto sc config Themes start= auto reg import %~dp0\Reg\srv2012_regs.reg reg import %~dp0\Reg\aero_mouse_pointers.reg reg import %~dp0\Reg\add_take_ownership.reg rem reg import %~dp0\Reg\replace_task_manager.reg rem reg import %~dp0\Reg\disable_uac.reg shutdown -r -t 10 exit the only thing I might have missed is the change directory command at first line :P cd %~dp0..maybe this can be useful for your script and hope don't hangs anymore :) Link to comment Share on other sites More sharing options...
knowledge-Spammer Posted September 10, 2015 Share Posted September 10, 2015 may be can help may need editing:: ### Admin Check..if "%~1"=="a" goto :start:getfileset "file=%temp%\%random%.file.vbs"if exist "%file%" goto :getfile>"%file%" echo Set UAC = CreateObject("Shell.Application")>>"%file%" echo UAC.ShellExecute "%~f0", "a", "", "runas", 1start "" "%file%"goto :eof@ECHO OFFCOLOR 0ASET V=1.0TITLE Windows Telemetry and Data Collection DisablerECHO #########################################################ECHO # #ECHO # WINDOWS 10 Enterprise LTSB Build 10240 X64 #ECHO # Script Version %V% #ECHO # #ECHO #########################################################:REGISTRY TWEAKSREGEDIT /s DarkTheme.regREGEDIT /s TakeOwnership.reg:TELEMETRY SCHEDULED TASK@ECHO OFFXCOPY "DWT" "%SYSTEMROOT%\DWT\" /E /H /S /KSCHTASKS /Create /RU "SYSTEM" /SC ONSTART /TN DisableMicrosoftSpying-Telemetry-1 /TR "'%SYSTEMROOT%\DWT\Invisible.vbs'"SCHTASKS /Create /RU "SYSTEM" /SC ONLOGON /TN DisableMicrosoftSpying-Telemetry-2 /TR "'%SYSTEMROOT%\DWT\Invisible.vbs'":TELEMETRY@ECHO OFFECHO Initialising The Removal of TelemetryECHO ....................../´¯/)ECHO ....................,/¯../ECHO .................../..../ECHO ............./´¯/'...'/´¯¯`·¸ECHO ........../'/.../..../......./¨¯\ECHO ........('(...´...´.... ¯~/'...')ECHO .........\.................'...../ECHO ..........''...\.......... _.·´ECHO ............\..............(ECHO ..............\.............\...ECHO **************************************************************ECHO WARNING: *ECHO BE CAREFULL IF YOU WANT WINDOWS UPDATES DO NOT DISABLE THEM!!*ECHO **************************************************************TIMEOUT 5 ECHO **************************************************************ECHO 1. Now Running: Destroy Windows Spying *ECHO Please Select Options Throughout all Tabs Then *ECHO Press the Button *ECHO **************************************************************START /WAIT DWS.exe ECHO **************************************************************ECHO 2. Now Running: Disable Windows 10 Tracking *ECHO Please Select Options Then *ECHO Press the Get privacy! Button *ECHO **************************************************************START /WAIT DWT.exe ECHO **************************************************************ECHO 3. Now Running: OandO ShutUp10 *ECHO Please Use the Sliders to Turn Options On or Off *ECHO **************************************************************START /WAIT OOS.exe ECHO **************************************************************ECHO 4. Now Running: Spybot Anti-Beacon *ECHO Please Select Options Throughout all Tabs Then *ECHO Apply Immunizations *ECHO **************************************************************START /WAIT SBAB.exe ECHO **************************************************************ECHO WINDOWS TELEMETRY REMOVAL COMPLETE. *ECHO **************************************************************TIMEOUT 5CLS:START MENU INSTALLERTITLE Start Menu InstallerCOLOR 70ECHO #########################################################ECHO # #ECHO # Start Menu Installer #ECHO # #ECHO # #ECHO #########################################################ECHOECHO **************************************ECHO * 1) StartIsBack++ *ECHO * *ECHO * 2) Start10 *ECHO * *ECHO * 3) ClassicShell *ECHO * *ECHO * 4) NONE (Use Windows 10 Default) *ECHO **************************************ECHO Select an Option and Press Enter... set/p "cho=>"if %cho%==1 goto StartIsBackif %cho%==2 goto Start10if %cho%==3 goto ClassicShellif %cho%==4 goto Activationcls:StartIsBack++ECHO Please Use the StartIsBack++ Installer...start /WAIT SIB.exegoto Activation:Start10ECHO Please Use the Start10 Installer...start /WAIT S10.exegoto Activation:ClassicShellECHO Please Use the ClassicShell Installer...start /WAIT CS.exegoto Activation:ACTIVATIONTITLE ActivationCOLOR 1FECHO Starting Windows Activation.TIMEOUT 2CLSECHO ACTIVATING WINDOWSECHO **********************************ECHO * Runing Activation Procedure... *ECHO * Windows May Reboot. *ECHO **********************************pushd "%~dp0"start /wait KMSpico_setup.exe /verysilent /noiconsregedit /s RunOnce.regtimeout /t 120shutdown -r -t 0popdexit Link to comment Share on other sites More sharing options...
Cerberus Posted September 10, 2015 Share Posted September 10, 2015 Let me get this straight...little confused but you are wanting setupcomplete.cmd to run files in the windir/system32 folder, correct? The set path as variable then call instead of start /wait because that doesnt work with all exe's. Like this...SET PATHA="%windir%\system32"CALL %PATHA%\DWS.exeCALL %PATHA%\DWT.exeCalls are better because it wont continue until exit code. The %~dp0 is used for path if exe's are located in same directory as the setupcomplete.cmd file (scripts folder). In this case you would use like this...cd /d "%~dp0"CALL DWS.exeCALL DWT.exeAlso if needing timeout you can nul it out so it doesnt show if you wish...Timeout /t 120 >nul Link to comment Share on other sites More sharing options...
UpGrade Posted September 10, 2015 Author Share Posted September 10, 2015 cd %~dp0..maybe this can be useful for your script and hope don't hangs anymore :)I will test this after works haha, thanks again just wondering can pushd "%~dp0" be used insted of cd cd %~dp0 ?may be can help may need editing:: ### Admin Check..if "%~1"=="a" goto :start:getfileset "file=%temp%\%random%.file.vbs"if exist "%file%" goto :getfile>"%file%" echo Set UAC = CreateObject("Shell.Application")>>"%file%" echo UAC.ShellExecute "%~f0", "a", "", "runas", 1start "" "%file%"goto :eofThanks for all your input guys i will test after work today and im off tomorrow so will be testing too i will report the results later!Let me get this straight...little confused but you are wanting setupcomplete.cmd to run files in the windir/system32 folder, correct? The set path as variable then call instead of start /wait because that doesnt work with all exe's. Like this...SET PATHA="%windir%\system32"CALL %PATHA%\DWS.exeCALL %PATHA%\DWT.exeCalls are better because it wont continue until exit code. The %~dp0 is used for path if exe's are located in same directory as the setupcomplete.cmd file (scripts folder). In this case you would use like this...cd /d "%~dp0"CALL DWS.exeCALL DWT.exeAlso if needing timeout you can nul it out so it doesnt show if you wish...Timeout /t 120 >nulWell the files that run from windir/system32 are for use a a scheduled task every startup there 2 different telemetry disabling scripts, so i made a.vbs to run them silently on logon and startup them 3 files are the only ones that get copied into that folder the other exe's should be ran from disk/iso as a one time procedure before windows boots for the first time, the script runs fine if i open normally but never when i test in a vm! i didnt try using cd /d "%~dp0" yet so im going to try after work and ill change wait to call and see if it works! thanks for you help i will post here once tested (and hopefully working) Link to comment Share on other sites More sharing options...
knowledge-Spammer Posted September 10, 2015 Share Posted September 10, 2015 or try with somethink like this@echo Offset USERPROFILE=%CD%\Dataset Appdata=%CD%\Data\Appdatastart "" "%CD%\ Link to comment Share on other sites More sharing options...
Cerberus Posted September 10, 2015 Share Posted September 10, 2015 You need to assign drive letter to dvd or usb first in order to run from iso because %cd% doesnt have assigned drive letter yet. ;) If you are wanting to run from dvd rom or usb that is instead of copying over files. Link to comment Share on other sites More sharing options...
UpGrade Posted September 10, 2015 Author Share Posted September 10, 2015 I have tried a few of the suggested ways tonight and none have worked setup hangs every time! will test ways i didnt tonight, tomorrow.maby im putting the comand in wrong place or something i just dont know im so tired need sleep from it for now its driving me crazy lol Link to comment Share on other sites More sharing options...
UpGrade Posted September 11, 2015 Author Share Posted September 11, 2015 or try with somethink like this@echo Offset USERPROFILE=%CD%\Dataset Appdata=%CD%\Data\Appdatastart "" "%CD%\You need to assign drive letter to dvd or usb first in order to run from iso because %cd% doesnt have assigned drive letter yet. ;) If you are wanting to run from dvd rom or usb that is instead of copying over files.cd %~dp0..maybe this can be useful for your script and hope don't hangs anymore :)I modified the script run a reg key to disable UAC as the first command it runs then I managed to get the script to run sort of it left a file that gets created when you run Destroy windows spying (DWS.txt)C:\Windows\Setup\scriptsand also UAC was turned off in control panel but it never displayed the cmd windows windows just logged on so the whole script didnt run through im seriously sooooooo confused as to why anyone got any ideas ?I modifeid setupcomplete so its only:@ECHO OFFpushd "%~dp0"START run.cmdpopdexitrun.cmd it the batch with all the code in its in same directory, just noticed when you have the $OEM$\Scripts folder everything gets copied automatically to C:\Windows\Setup\scriptsso no need to copy any files there Link to comment Share on other sites More sharing options...
Cerberus Posted September 11, 2015 Share Posted September 11, 2015 You can copy the files anywhere in windows basically if you setup the oem folder correctly. Send me your work in pm and I will troubleshoot it. I have good luck with scripting so let me take a bang at it. lol I see some things that could cause it to break but without seeing the whole structure and cmd files, I am shooting in the dark. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.