Advertisement
Guest User

mystupidbatchscriptsofar.bat

a guest
Jul 14th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. cls
  3. goto :begin
  4. :ArchInstall
  5. powershell -noprofile -command "wget "https://raw.githubusercontent.com/alwsl/alwsl/master/alwsl.bat" -o C:\alwsl.bat"
  6. if %ERRORLEVEL%=0 goto :SkipPasterrorwget
  7. echo ERROR, reattempting to download in 10 seconds
  8. timeout /t 10
  9. goto :ArchInstall
  10. @cmd
  11. cd C:\
  12. C:\alwsl.bat install
  13. C:\alwsl.bat snapshot create
  14. C:\alwsl.bat snapshot list > C:\ALWSL.snapshots
  15. bash -c "rm -f /etc/sudoers"
  16. (
  17. echo ## sudoers file.
  18. echo ##
  19. echo ## This file MUST be edited with the 'visudo' command as root.
  20. echo ## Failure to use 'visudo' may result in syntax or file permission errors
  21. echo ## that prevent sudo from running.
  22. echo ##
  23. echo ## See the sudoers man page for the details on how to write a sudoers file.
  24. echo ##
  25. echo
  26. echo ##
  27. echo ## Host alias specification
  28. echo ##
  29. echo ## Groups of machines. These may include host names (optionally with wildcards),
  30. echo ## IP addresses, network numbers or netgroups.
  31. echo # Host_Alias   WEBSERVERS = www1, www2, www3
  32. echo
  33. echo ##
  34. echo ## User alias specification
  35. echo ##
  36. echo ## Groups of users.  These may consist of user names, uids, Unix groups,
  37. echo ## or netgroups.
  38. echo # User_Alias   ADMINS = millert, dowdy, mikef
  39. echo
  40. echo ##
  41. echo ## Cmnd alias specification
  42. echo ##
  43. echo ## Groups of commands.  Often used to group related commands together.
  44. echo # Cmnd_Alias   PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
  45. echo #              /usr/bin/pkill, /usr/bin/top
  46. echo # Cmnd_Alias   REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff
  47. echo
  48. echo ##
  49. echo ## Defaults specification
  50. echo ##
  51. echo ## You may wish to keep some of the following environment variables
  52. echo ## when running commands via sudo.
  53. echo ##
  54. echo ## Locale settings
  55. echo # Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
  56. echo ##
  57. echo ## Run X applications through sudo; HOME is used to find the
  58. echo ## .Xauthority file.  Note that other programs use HOME to find  
  59. echo ## configuration files and this may lead to privilege escalation!
  60. echo # Defaults env_keep += "HOME"
  61. echo ##
  62. echo ## X11 resource path settings
  63. echo # Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
  64. echo ##
  65. echo ## Desktop path settings
  66. echo # Defaults env_keep += "QTDIR KDEDIR"
  67. echo ##
  68. echo ## Allow sudo-run commands to inherit the callers' ConsoleKit session
  69. echo # Defaults env_keep += "XDG_SESSION_COOKIE"
  70. echo ##
  71. echo ## Uncomment to enable special input methods.  Care should be taken as
  72. echo ## this may allow users to subvert the command being run via sudo.
  73. echo # Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
  74. echo ##
  75. echo ## Uncomment to use a hard-coded PATH instead of the user's to find commands
  76. echo # Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  77. echo ##
  78. echo ## Uncomment to send mail if the user does not enter the correct password.
  79. echo # Defaults mail_badpass
  80. echo ##
  81. echo ## Uncomment to enable logging of a command's output, except for
  82. echo ## sudoreplay and reboot.  Use sudoreplay to play back logged sessions.
  83. echo # Defaults log_output
  84. echo # Defaults!/usr/bin/sudoreplay !log_output
  85. echo # Defaults!/usr/local/bin/sudoreplay !log_output
  86. echo # Defaults!REBOOT !log_output
  87. echo
  88. echo ##
  89. echo ## Runas alias specification
  90. echo ##
  91. echo
  92. echo ##
  93. echo ## User privilege specification
  94. echo ##
  95. echo root ALL=(ALL) ALL
  96. echo
  97. echo ## Uncomment to allow members of group wheel to execute any command
  98. echo wheel ALL=(ALL) ALL
  99. echo
  100. echo ## Same thing without a password
  101. echo # %wheel ALL=(ALL) NOPASSWD: ALL
  102. echo
  103. echo ## Uncomment to allow members of group sudo to execute any command
  104. echo # %sudo    ALL=(ALL) ALL
  105. echo
  106. echo ## Uncomment to allow any user to run sudo if they know the password
  107. echo ## of the user they are running the command as (root by default).
  108. echo # Defaults targetpw  # Ask for the password of the target user
  109. echo # ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'
  110. echo
  111. echo ## Read drop-in files from /etc/sudoers.d
  112. echo ## (the '#' here does not indicate a comment)
  113. echo #includedir /etc/sudoers.d
  114. ) > %localappdata%\Lxss\rootfs\etc\sudoers
  115.  
  116.  
  117. :UbuntuInstall
  118. :begin
  119. echo Beginning installer
  120. echo
  121. timeout /t 1 > nul
  122. color 0C
  123. echo /* This program is free software. It comes without any warranty, to
  124. echo * the extent permitted by applicable law. You can redistribute it
  125. echo * and/or modify it under the terms of the Do What The Fuck You Want
  126. echo * To Public License, Version 2, as published by Sam Hocevar. See
  127. echo * http://sam.zoy.org/wtfpl/COPYING for more details. */
  128. echo
  129. echo This batch script
  130. echo
  131. echo This program should only work on 64bit Operating Systems,
  132. echo for a 32bit version contact me on Discord @Adrian#9492
  133. echo Press a key to continue or (Ctrl + C) to exit
  134.  
  135. timeout /t 99999 > nul
  136. cls
  137. color 0F
  138. timeout /t 2 > nul
  139. echo Hello! Welcome to the installer for the Windows/WSL desktop
  140. timeout /t 4 > nul
  141. echo Before you start, I'd like to ask you a few questions...
  142. echo
  143. echo
  144. :choice6
  145. set /P choice6=Do you just need to configure settings?
  146. if %choice6%=Y goto :settings
  147.  
  148. :choice1
  149. set /P choice1=Do you want the Arch WSL over the Ubuntu WSL? (Y/N/H) (H means SKIP install of WSL)
  150.  
  151. :choice2
  152. set /P choice2=Have you already downloaded and installed Dexpot? (Y/N)
  153.  
  154. :choice3
  155. set /P choice3=Do you have VcXsrv installed? (Y/N)
  156.  
  157. :choice4
  158. set /P choice4=Do you have a system restore point? (Y/N)
  159.  
  160. :choice5
  161. set /P choice5=Do you have the WSL enabled? (Y/N)
  162.  
  163.  
  164. :installbegin
  165.  
  166. if %chocie4%=N
  167.     echo Please make one, I'm not responsible for any losses that might occur
  168.     goto :begin
  169. if %choice5%=N start https://stackoverflow.com/questions/36352627/how-to-enable-bash-in-windows-10-developer-preview
  170.     echo Please follow the guide opened in your browser. When you're done press any key.
  171.     timeout /t 99999 > nul
  172. if %choice4%=Y goto :choices
  173.  
  174. goto :begin
  175.  
  176. :choices
  177. if %choice2%=N goto :DexpotInstall
  178. if %choice3%=N goto :VcXsrvInstall
  179. if %choice1%=Y goto :ArchInstall
  180. if %choice1%=N goto :UbuntuInstall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement