BATCH-commande





==================130919==========

@echo off


cls


set /p dirr= put dirctory lettr:



cls


echo %computername% >%dirr%:\%computername%%last%.txt


echo %name% %first% >>%dirr%:\%computername%%last%.txt


wmic bios get serialnumber >>%dirr%:\%computername%%last%.txt


wmic csproduct get identifyingnumber > %dirr%:\%computername%%last%.txt

==================130919==========

===============================12-09-2019=לאיסוף סיקרלים ניידים 36 עגלה חדשה ==========================


@echo off

cls

set /p dirr= put dirctory lettr:



cls

echo %computername% >%dirr%:\%computername%%last%.txt

echo %name% %first% >>%dirr%:\%computername%%last%.txt

wmic bios get serialnumber >>%dirr%:\%computername%%last%.txt


======================12-09-2019=לאיסוף סיקרלים ניידים 36 עגלה חדשה ========

==================================== gam-setup.bat ===================

:neworupgrade

@echo(

@set /p nu= "Is this a new install or an upgrade? [n or u] "

@if /I "%nu%"=="u" (

@ echo GAM installation and setup complete!

@ goto alldone

)

@if /I not "%nu%"=="n" (

@ echo(

@ echo Please answer n or u.

@ goto neworupgrade

)


:createproject

@echo(

@set /p yn= "Are you ready to set up a Google API project for GAM? [y or n] "

@if /I "%yn%"=="n" (

@ echo(

@ echo You can create an API project later by running:

@ echo(

@ echo gam create project

@ goto alldone

)

@if /I not "%yn%"=="y" (

@ echo(

@ echo Please answer y or n.

@ goto createproject

)

@echo(

@set /p adminemail= "Please enter your G Suite admin email address: "

@gam create project %adminemail%

@if not ERRORLEVEL 1 goto projectdone

@echo(

@echo Project creation failed. Trying again. Say n to skip project creation.

@goto createproject

:projectdone


:adminauth

@echo(

@set /p yn= "Are you ready to authorize GAM to perform G Suite management operations as your admin account? [y or n] "

@if /I "%yn%"=="n" (

@ echo(

@ echo You can authorize an admin later by running:

@ echo(

@ echo gam oauth create %adminemail%

@ goto admindone

)

@if /I not "%yn%"=="y" (

@ echo(

@ echo Please answer y or n.

@ goto adminauth

)

@gam oauth create %adminemail%

@if not ERRORLEVEL 1 goto admindone

@echo(

@echo Admin authorization failed. Trying again. Say n to skip admin authorization.

@goto adminauth

:admindone


:saauth

@echo(

@set /p yn= "Are you ready to authorize GAM to manage G Suite user data and settings? [y or n] "

@if /I "%yn%"=="n" (

@ echo(

@ echo You can authorize a service account later by running:

@ echo(

@ echo gam user %adminemail% check serviceaccount

@ goto sadone

)

@if /I not "%yn%"=="y" (

@ echo(

@ echo Please answer y or n.

@ goto saauth

)

@echo(

@set /p regularuser= "Please enter the email address of a regular G Suite user: "

@echo Great! Checking service account scopes. This will fail the first time. Follow the steps to authorize and retry. It can take a few minutes for scopes to PASS after they've been authorized in the admin console.

@gam user %regularuser% check serviceaccount

@if not ERRORLEVEL 1 goto sadone

@echo(

@echo Service account authorization failed. Confirm you entered the scopes correctly in the admin console. It can take a few minutes for scopes to PASS after they are entered in the admin console so if you're sure you entered them correctly, go grab a coffee and then hit Y to try again. Say N to skip admin authorization.

@goto saauth

:sadone


@echo GAM installation and setup complete!

:alldone

@pause





XXXXXXXXXXXXXXXXXXXXXXXXXXX

https://ss64.com/nt/set.html

https://www.computerhope.com/sethlp.htm

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1

===========================


set/p

https://en.wikibooks.org/wiki/Windows_Batch_Scripting#SET

SET[edit]

Displays or sets environment variables. With /P switch, it asks the user for input, storing the result in the variable. With /A switch, it performs simple arithmetic calculations, storing the result in the variable. With string assignments, there must be no spaces before and after the equality sign; thus, "set name = Peter" does not work, while "set name=Peter" does.

Examples:

  • set
    • Displays a list of environment variables
  • set HOME
    • Displays the values of the environment variables whose names start with "HOME"
  • set MYNUMBER=56
  • set HOME=%HOME%;C:\Program Files\My Bin Folder
  • set /P user_input=Enter an integer:
  • set /A result = 4 * ( 6 / 3 )
    • Sets the result variable with the result of a calculation. See also #Calculation


%last%

==============================================================================================


@echo off

cls

set /p name= Last Name :

set /p first= First Name :

set /p dirr= put dirctory Letter :

cls

echo %computername% >%dirr%:\%last%.txt

echo %name% %first% >>%dirr%:\%last%.txt

wmic bios get serialnumber >>%dirr%:\%last%.txt

===============================================================


@echo off

cls

set /p name= Last Name :

set /p first= First Name :

set /p dirr= put dirctory lettr:

set /p namfil= put name file:

cls

echo %name% %first% >>%dirr%:\%namfil%.txt

echo %computername% >%dirr%:\%namfil%.txt

wmic bios get serialnumber >>%dirr%:\%namfil%.txt


==========================================================

@ECHO OFF

:BEGIN

CLS

CHOICE /N /C:123 /M "PICK A NUMBER (1, 2, or 3)"%1

IF ERRORLEVEL ==3 GOTO THREE

IF ERRORLEVEL ==2 GOTO TWO

IF ERRORLEVEL ==1 GOTO ONE

GOTO END

:THREE

ECHO YOU HAVE PRESSED THREE

GOTO END

:TWO

ECHO YOU HAVE PRESSED TWO

GOTO END

:ONE

ECHO YOU HAVE PRESSED ONE

:END

pause

======================================================

@echo off

set VAR=before

if "%VAR%" == "before" (

set VAR=after

if "!VAR!" == "after" @echo If you see this, it worked

)

set LIST=

for %i in (*) do set LIST=!LIST! %i

echo %LIST%

====================================================

@ECHO off

cls

:start

ECHO.

ECHO 1. Print Hello

ECHO 2. Print Bye

ECHO 3. Print Test

set choice=

set /p choice=Type the number to print text.

if not '%choice%'=='' set choice=%choice:~0,1%

if '%choice%'=='1' goto hello

if '%choice%'=='2' goto bye

if '%choice%'=='3' goto test

ECHO "%choice%" is not valid, try again

ECHO.

goto start

:hello

ECHO HELLO

goto end

:bye

ECHO BYE

goto end

:test

ECHO TEST

goto end

:end