Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1294 connectés 

 


 Mot :   Pseudo :  
 
 Page :   1  2  3  4
Page Suivante
Auteur Sujet :

Creer un cd de windows 2000 contenant les drivers de son parc info?

n°1089362
boomboommu​sic
Posté le 10-03-2003 à 21:14:28  profilanswer
 

Reprise du message précédent :
geniale boisorbe toute fraiche la maj.....

mood
Publicité
Posté le 10-03-2003 à 21:14:28  profilanswer
 

n°1089387
rogntudjuu​uuuuuuu
Posté le 10-03-2003 à 21:27:05  profilanswer
 
n°1089583
JerryCrazy
Le plus crazy des crazy
Posté le 10-03-2003 à 23:45:32  profilanswer
 

bagu a écrit :

yargh...j'ai du me gourer qq part...ca me demande d'"insérer la disquette nommée windows xp dans le lecteur A:"  
 
 
 [:sharpknife]  [:sharpknife]  [:sharpknife]  
 
et un cd de foutu !!!

CD-RW [:joce]


---------------
JerryCrazy - My Digital Life - Ferrovia.be - Jeux Linux
n°1089587
JerryCrazy
Le plus crazy des crazy
Posté le 11-03-2003 à 00:01:51  profilanswer
 
n°1089642
bagu
Posté le 11-03-2003 à 01:14:08  profilanswer
 


gnagnagna...c po gentil :D  
 
maintenant je fais gaffe.... :whistle:

n°1090815
JerryCrazy
Le plus crazy des crazy
Posté le 11-03-2003 à 19:03:02  profilanswer
 

bagu a écrit :


gnagnagna...c po gentil :D  
 
maintenant je fais gaffe.... :whistle:  

moi,perso,ca fait quelque mois que j'ai un CD RW Windows 2000,l'avantage,c'est que quand tu dois mettre a jour WMP ou DX ou meme Windows sur le CD,bah,je gache pas de CD  :p


---------------
JerryCrazy - My Digital Life - Ferrovia.be - Jeux Linux
n°1090838
bagu
Posté le 11-03-2003 à 19:12:40  profilanswer
 

Ben moi j'utilisai rein du tout...et quand j'etait sur que ca marcherai, ben j'avais mis ca sur cd...
Mais ca a merdé pour les raisons que tu connais...
Mais maintenant je met ca sur cd-rw  :bounce:

n°1090841
JerryCrazy
Le plus crazy des crazy
Posté le 11-03-2003 à 19:13:22  profilanswer
 

bagu a écrit :

Ben moi j'utilisai rein du tout...et quand j'etait sur que ca marcherai, ben j'avais mis ca sur cd...
Mais ca a merdé pour les raisons que tu connais...
Mais maintenant je met ca sur cd-rw  :bounce:  

:D


---------------
JerryCrazy - My Digital Life - Ferrovia.be - Jeux Linux
n°1090856
boomboommu​sic
Posté le 11-03-2003 à 19:31:46  profilanswer
 

Vous savez ou on peut se procurer les hotfixs :/
paskeu le ftp de crosoft ne les donne pas...

n°1090918
bagu
Posté le 11-03-2003 à 20:10:53  profilanswer
 
mood
Publicité
Posté le 11-03-2003 à 20:10:53  profilanswer
 

n°1091735
boomboommu​sic
Posté le 12-03-2003 à 12:40:37  profilanswer
 

merci bagu...

n°1091753
bagu
Posté le 12-03-2003 à 12:52:59  profilanswer
 

sans probleme... ;)  
 
C un autre forumeur qui a poster ce lien génial !...du coup, je l'ai mis dans mon forum...histoire de ne pas l'oublier  :D

n°1093759
boomboommu​sic
Posté le 13-03-2003 à 21:14:42  profilanswer
 

J ai un autre probleme maintenant
 
shutdown.exe n eteint pas le PC sur ma machine de test..windows fait "comme ci" il "s'eteignait" mais juste avant de s'eteindre il s arrete..je me retrouve avec un ecran bleu (couleur fond d ecran standart donc pas le bluescreen) et c est tout...
Y a t il un autre utilitaire qui mme permettrait d eteindre le PC....
 
Eventuellement un batch me permettant l extinction de windows par exemple celui utiliser par windows lui meme lorsque l on fait demarrer/arreter !!!!
 
EDIT:::: JE ME SUIS GOURU JE VEUX PAS  ETEINDRE MAS REDEMARRER


Message édité par boomboommusic le 13-03-2003 à 21:23:03
n°1093805
boisorbe
Posté le 13-03-2003 à 21:50:11  profilanswer
 

eteindre ca marche bien avec shutdown.exe
 
sinon il y a un outils chez supinfo (mais j'y accede pas ce soir)
 
et plein d'autres en down outils le net
 
sinon regarde ce lien je suis tombe dessus hier et ca a pas l'air mal (pas eu le temps de tester)
http://www.robvanderwoude.com/rundll.html


---------------
"Tout ce que je sais c'est que je ne sais rien" Socrate
n°1093812
boisorbe
Posté le 13-03-2003 à 21:54:26  profilanswer
 

j'ai trouve ca aussi mais pas essaye non plus ;)

Code :
  1. '********************************************************************
  2. '*
  3. '* File:           Restart.vbs
  4. '* Created:        March 1999
  5. '* Version:        1.0
  6. '*
  7. '*  Main Function:  Shutsdown, PowerOff, LogOff, Restarts a machine.
  8. '*
  9. '*  Restart.vbs    /S <server> [/U <username>] [/W <password>]
  10. '*                 [/O <outputfile>] [/L} [/P] [/R] [/Q] [/F] [/T <time in seconds>]
  11. '*
  12. '* Copyright (C) 1999 Microsoft Corporation
  13. '*
  14. '********************************************************************
  15. OPTION EXPLICIT
  16.     'Define constants
  17.     CONST CONST_ERROR                   = 0
  18.     CONST CONST_WSCRIPT                 = 1
  19.     CONST CONST_CSCRIPT                 = 2
  20.     CONST CONST_SHOW_USAGE              = 3
  21.     CONST CONST_PROCEED                 = 4
  22.     'Shutdown Method Constants
  23.     CONST CONST_SHUTDOWN                = 1
  24.     CONST CONST_LOGOFF                  = 0
  25.     CONST CONST_POWEROFF                = 8
  26.     CONST CONST_REBOOT                  = 2
  27.     CONST CONST_FORCE_REBOOT            = 6
  28.     CONST CONST_FORCE_POWEROFF          = 12
  29.     CONST CONST_FORCE_LOGOFF            = 4
  30.     CONST CONST_FORCE_SHUTDOWN          = 5
  31.    
  32.     'Declare variables
  33.     Dim intOpMode, i
  34.     Dim strServer, strUserName, strPassword, strOutputFile
  35.     Dim blnLogoff, blnPowerOff, blnReBoot, blnShutDown
  36.     Dim blnForce
  37.     Dim intTimer
  38.     Dim UserArray(3)
  39.     Dim MyCount
  40.     'Make sure the host is csript, if not then abort
  41.     VerifyHostIsCscript()
  42.     'Parse the command line
  43.     intOpMode = intParseCmdLine(strServer     ,  _
  44.                                 strUserName   ,  _
  45.                                 strPassword   ,  _
  46.                                 strOutputFile ,  _
  47.                                 blnLogoff     ,  _
  48.                                 blnPowerOff   ,  _
  49.                                 blnReBoot     ,  _
  50.                                 blnShutdown   ,  _
  51.                                 blnForce      ,  _
  52.                                 intTimer         )
  53.     Select Case intOpMode
  54.         Case CONST_SHOW_USAGE
  55.             Call ShowUsage()
  56.         Case CONST_PROCEED               
  57.             Call Reboot(strServer     , _
  58.                           strOutputFile , _
  59.                           strUserName   , _
  60.                           strPassword   , _
  61.                           blnReboot     , _
  62.                           blnForce      , _
  63.                           intTimer        )
  64.             Call LogOff(strServer     , _
  65.                           strOutputFile , _
  66.                           strUserName   , _
  67.                           strPassword   , _
  68.                           blnLogoff     , _
  69.                           blnForce      , _
  70.                           intTimer        )
  71.             Call PowerOff(strServer     , _
  72.                           strOutputFile , _
  73.                           strUserName   , _
  74.                           strPassword   , _
  75.                           blnPowerOff   , _
  76.                           blnForce      , _
  77.                           intTimer        )
  78.             Call ShutDown(strServer     , _
  79.                           strOutputFile , _
  80.                           strUserName   , _
  81.                           strPassword   , _
  82.                           blnShutDown   , _
  83.                           blnForce      , _
  84.                           intTimer        )
  85.         Case CONST_ERROR
  86.             'Do Nothing
  87.         Case Else                    'Default -- should never happen
  88.             Call Wscript.Echo("Error occurred in passing parameters." )
  89.     End Select
  90. '********************************************************************
  91. '*
  92. '* Sub Reboot()
  93. '*
  94. '* Purpose: Reboots a machine.
  95. '*
  96. '* Input:   strServer           a machine name
  97. '*          strOutputFile       an output file name
  98. '*          strUserName         the current user's name
  99. '*          strPassword         the current user's password
  100. '*          blnForce            specifies whether to force the logoff
  101. '*          intTimer            specifies the amount of time to perform the function
  102. '*
  103. '* Output:  Results are either printed on screen or saved in strOutputFile.
  104. '*
  105. '********************************************************************
  106. Private Sub Reboot(strServer, strOutputFile, strUserName, strPassword, blnReboot, blnForce, intTimer)
  107.     ON ERROR RESUME NEXT
  108.     Dim objFileSystem, objOutputFile, objService, objEnumerator, objInstance
  109.     Dim strQuery, strMessage
  110.     Dim intStatus
  111.     ReDim strID(0), strName(0)
  112.     if blnreboot = false then
  113.          Exit Sub
  114.     End if
  115.     if intTimer > 0 then
  116.         wscript.echo "Rebooting machine " & strServer & " in " & intTimer & " seconds..."
  117.         wscript.sleep (intTimer * 1000)
  118.     End if
  119.     'Open a text file for output if the file is requested
  120.     If Not IsEmpty(strOutputFile) Then
  121.         If (NOT blnOpenFile(strOutputFile, objOutputFile)) Then
  122.             Call Wscript.Echo ("Could not open an output file." )
  123.             Exit Sub
  124.         End If
  125.     End If
  126.     'Establish a connection with the server.
  127.     If blnConnect("root\cimv2" , _
  128.                    strUserName , _
  129.                    strPassword , _
  130.                    strServer   , _
  131.                    objService  ) Then
  132.         Call Wscript.Echo("" )
  133.         Call Wscript.Echo("Please check the server name, " _
  134.                         & "credentials and WBEM Core." )
  135.         Exit Sub
  136.     End If
  137.     strID(0) = ""
  138.     strName(0) = ""
  139.     strMessage = ""
  140.     strQuery = "Select * From Win32_OperatingSystem"
  141.     Set objEnumerator = objService.ExecQuery(strQuery,,0)
  142.     If Err.Number Then
  143.         Print "Error 0x" & CStr(Hex(Err.Number)) & " occurred during the query."
  144.         If Err.Description <> "" Then
  145.             Print "Error description: " & Err.Description & "."
  146.         End If
  147.         Err.Clear
  148.         Exit Sub
  149.     End If
  150.     i = 0
  151.     For Each objInstance in objEnumerator
  152.         If blnForce Then
  153.             intStatus = objInstance.Win32ShutDown(CONST_FORCE_REBOOT)
  154.         Else
  155.             intStatus = objInstance.Win32ShutDown(CONST_REBOOT)
  156.         End If
  157.         IF intStatus = 0 Then
  158.             strMessage = "Reboot a machine " & strServer & "."
  159.         Else
  160.             strMessage = "Failed to reboot a machine " & strServer & "."
  161.         End If
  162.         Call WriteLine(strMessage,objOutputFile)
  163.     Next
  164.     If IsObject(objOutputFile) Then
  165.         objOutputFile.Close
  166.         Call Wscript.Echo ("Results are saved in file " & strOutputFile & "." )
  167.     End If
  168. End Sub
  169. '********************************************************************
  170. '*
  171. '* Sub LogOff()
  172. '*
  173. '* Purpose: Logs off the user currently logged onto a machine.
  174. '*
  175. '* Input:   strServer           a machine name
  176. '*          strOutputFile       an output file name
  177. '*          strUserName         the current user's name
  178. '*          strPassword         the current user's password
  179. '*          blnForce            specifies whether to force the logoff
  180. '*          intTimer            specifies the amount of time to preform the function
  181. '*
  182. '* Output:  Results are either printed on screen or saved in strOutputFile.
  183. '*
  184. '********************************************************************
  185. Private Sub LogOff(strServer, strOutputFile, strUserName, strPassword, blnLogoff, blnForce, intTimer)
  186.     ON ERROR RESUME NEXT
  187.     Dim objFileSystem, objOutputFile, objService, objEnumerator, objInstance
  188.     Dim strQuery, strMessage
  189.     Dim intStatus
  190.     ReDim strID(0), strName(0)
  191.      If blnlogoff = false then
  192.           Exit Sub
  193.      End if
  194. if intTimer > 1 then
  195.  wscript.echo "Logging off machine " & strServer & " in " & intTimer & " seconds..."
  196.  wscript.sleep (intTimer * 1000)
  197. End if
  198.     'Open a text file for output if the file is requested
  199.     If Not IsEmpty(strOutputFile) Then
  200.         If (NOT blnOpenFile(strOutputFile, objOutputFile)) Then
  201.             Call Wscript.Echo ("Could not open an output file." )
  202.             Exit Sub
  203.         End If
  204.     End If
  205.     'Establish a connection with the server.
  206.     If blnConnect("root\cimv2" , _
  207.                    strUserName , _
  208.                    strPassword , _
  209.                    strServer   , _
  210.                    objService  ) Then
  211.         Call Wscript.Echo("" )
  212.         Call Wscript.Echo("Please check the server name, " _
  213.                         & "credentials and WBEM Core." )
  214.         Exit Sub
  215.     End If
  216.     strID(0) = ""
  217.     strName(0) = ""
  218.     strMessage = ""
  219.     strQuery = "Select * From Win32_OperatingSystem"
  220.     Set objEnumerator = objService.ExecQuery(strQuery,,0)
  221.     If Err.Number Then
  222.         Print "Error 0x" & CStr(Hex(Err.Number)) & " occurred during the query."
  223.         If Err.Description <> "" Then
  224.             Print "Error description: " & Err.Description & "."
  225.         End If
  226.         Err.Clear
  227.         Exit Sub
  228.     End If
  229.     i = 0
  230.     For Each objInstance in objEnumerator
  231.         If blnForce Then
  232.             intStatus = objInstance.Win32ShutDown(CONST_FORCE_LOGOFF)
  233.         Else
  234.             intStatus = objInstance.Win32ShutDown(CONST_LOGOFF)
  235.         End If
  236.         IF intStatus = 0 Then
  237.             strMessage = "Logging off the current user on machine " & _
  238.                          strServer & "..."
  239.         Else
  240.             strMessage = "Failed to log off the current user from machine " _
  241.                 & strServer & "."
  242.         End If
  243.         Call WriteLine(strMessage,objOutputFile)
  244.     Next
  245.     If IsObject(objOutputFile) Then
  246.         objOutputFile.Close
  247.         Call Wscript.Echo ("Results are saved in file " & strOutputFile & "." )
  248.     End If
  249. End Sub
  250. '********************************************************************
  251. '*
  252. '* Sub PowerOff()
  253. '*
  254. '* Purpose: Powers off a machine.
  255. '*
  256. '* Input:   strServer           a machine name
  257. '*          strOutputFile       an output file name
  258. '*          strUserName         the current user's name
  259. '*          strPassword         the current user's password
  260. '*          blnForce            specifies whether to force the logoff
  261. '*          intTimer            specifies the amount of time to perform the function
  262. '*
  263. '* Output:  Results are either printed on screen or saved in strOutputFile.
  264. '*
  265. '********************************************************************
  266. Private Sub PowerOff(strServer, strOutputFile, strUserName, strPassword, blnPowerOff, blnForce, intTimer)
  267.     ON ERROR RESUME NEXT
  268.     Dim objFileSystem, objOutputFile, objService, objEnumerator, objInstance
  269.     Dim strQuery, strMessage
  270.     Dim intStatus
  271.     ReDim strID(0), strName(0)
  272.       if blnPoweroff = false then
  273.              Exit sub
  274.       End if
  275.     If intTimer > 0 then
  276.         wscript.echo "Powering off machine " & strServer & " in " & intTimer & " seconds..."
  277. wscript.sleep (intTimer * 1000)
  278.     End if
  279.     'Open a text file for output if the file is requested
  280.     If Not IsEmpty(strOutputFile) Then
  281.         If (NOT blnOpenFile(strOutputFile, objOutputFile)) Then
  282.             Call Wscript.Echo ("Could not open an output file." )
  283.             Exit Sub
  284.         End If
  285.     End If
  286.     'Establish a connection with the server.
  287.     If blnConnect("root\cimv2" , _
  288.                    strUserName , _
  289.                    strPassword , _
  290.                    strServer   , _
  291.                    objService  ) Then
  292.         Call Wscript.Echo("" )
  293.         Call Wscript.Echo("Please check the server name, " _
  294.                         & "credentials and WBEM Core." )
  295.         Exit Sub
  296.     End If
  297.     strID(0) = ""
  298.     strName(0) = ""
  299.     strMessage = ""
  300.     strQuery = "Select * From Win32_OperatingSystem"
  301.     Set objEnumerator = objService.ExecQuery(strQuery,,0)
  302.     If Err.Number Then
  303.         Print "Error 0x" & CStr(Hex(Err.Number)) & " occurred during the query."
  304.         If Err.Description <> "" Then
  305.             Print "Error description: " & Err.Description & "."
  306.         End If
  307.         Err.Clear
  308.         Exit Sub
  309.     End If
  310.     i = 0
  311.     For Each objInstance in objEnumerator
  312.         If blnForce Then
  313.             intStatus = objInstance.Win32ShutDown(CONST_FORCE_POWEROFF)
  314.         Else
  315.             intStatus = objInstance.Win32ShutDown(CONST_POWEROFF)
  316.         End If
  317.         IF intStatus = 0 Then
  318.             strMessage = "Power off machine " & strServer & "."
  319.         Else
  320.             strMessage = "Failed to power off machine " & strServer & "."
  321.         End If
  322.         Call WriteLine(strMessage,objOutputFile)
  323.     Next
  324.     If IsObject(objOutputFile) Then
  325.         objOutputFile.Close
  326.         Call Wscript.Echo ("Results are saved in file " & strOutputFile & "." )
  327.     End If
  328. End Sub
  329. '********************************************************************
  330. '*
  331. '* Sub Shutdown()
  332. '*
  333. '* Purpose: Shutsdown a machine.
  334. '*
  335. '* Input:   strServer           a machine name
  336. '*          strOutputFile       an output file name
  337. '*          strUserName         the current user's name
  338. '*          strPassword         the current user's password
  339. '*          blnForce            specifies whether to force the logoff
  340. '*          intTimer            specifies the amount of time to perform the function
  341. '*
  342. '* Output:  Results are either printed on screen or saved in strOutputFile.
  343. '*
  344. '********************************************************************
  345. Private Sub Shutdown(strServer, strOutputFile, strUserName, strPassword, blnShutDown, blnForce, intTimer)
  346.     ON ERROR RESUME NEXT
  347.     Dim objFileSystem, objOutputFile, objService, objEnumerator, objInstance
  348.     Dim strQuery, strMessage
  349.     Dim intStatus
  350.     ReDim strID(0), strName(0)
  351.     If blnShutdown = False then
  352.           Exit Sub
  353.     End if 
  354.     if intTimer > 0 then
  355.               wscript.echo "Shutting down computer " & strServer & " in " & intTimer & " seconds..."
  356.          wscript.sleep (intTimer * 1000)
  357.     End if
  358.     'Open a text file for output if the file is requested
  359.     If Not IsEmpty(strOutputFile) Then
  360.         If (NOT blnOpenFile(strOutputFile, objOutputFile)) Then
  361.             Call Wscript.Echo ("Could not open an output file." )
  362.             Exit Sub
  363.         End If
  364.     End If
  365.     'Establish a connection with the server.
  366.     If blnConnect("root\cimv2" , _
  367.                    strUserName , _
  368.                    strPassword , _
  369.                    strServer   , _
  370.                    objService  ) Then
  371.         Call Wscript.Echo("" )
  372.         Call Wscript.Echo("Please check the server name, " _
  373.                         & "credentials and WBEM Core." )
  374.         Exit Sub
  375.     End If
  376.     strID(0) = ""
  377.     strName(0) = ""
  378.     strMessage = ""
  379.     strQuery = "Select * From Win32_OperatingSystem"
  380.     Set objEnumerator = objService.ExecQuery(strQuery,,0)
  381.     If Err.Number Then
  382.         Print "Error 0x" & CStr(Hex(Err.Number)) & " occurred during the query."
  383.         If Err.Description <> "" Then
  384.             Print "Error description: " & Err.Description & "."
  385.         End If
  386.         Err.Clear
  387.         Exit Sub
  388.     End If
  389.     i = 0
  390.     For Each objInstance in objEnumerator
  391.         If blnForce Then
  392.             intStatus = objInstance.Win32ShutDown(CONST_FORCE_SHUTDOWN)
  393.         Else
  394.             intStatus = objInstance.Win32ShutDown(CONST_SHUTDOWN)
  395.         End If
  396.         IF intStatus = 0 Then
  397.             strMessage = "Shuts down machine " & strServer & "."
  398.         Else
  399.             strMessage = "Failed to shutdown machine " & strServer & "."
  400.         End If
  401.         Call WriteLine(strMessage,objOutputFile)
  402.     Next
  403.     If IsObject(objOutputFile) Then
  404.         objOutputFile.Close
  405.         Call Wscript.Echo ("Results are saved in file " & strOutputFile & "." )
  406.     End If
  407. End Sub
  408. '********************************************************************
  409. '*
  410. '* Function intParseCmdLine()
  411. '*
  412. '* Purpose: Parses the command line.
  413. '* Input: 
  414. '*
  415. '* Output:  strServer         a remote server ("" = local server" )
  416. '*          strUserName       the current user's name
  417. '*          strPassword       the current user's password
  418. '*          strOutputFile     an output file name
  419. '*          intTimer          amount of time in seconds
  420. '*
  421. '********************************************************************
  422. Private Function intParseCmdLine( ByRef strServer,        _
  423.                                   ByRef strUserName,      _
  424.                                   ByRef strPassword,      _
  425.                                   ByRef strOutputFile,    _
  426.                                   ByRef blnLogoff,        _
  427.                                   ByRef blnShutdown,      _
  428.                                   ByRef blnReboot,        _
  429.                                   ByRef blnPowerOff,      _
  430.                                   ByRef blnForce,         _
  431.                                   ByRef intTimer          )
  432.     ON ERROR RESUME NEXT
  433.     Dim strFlag
  434.     Dim intState, intArgIter
  435.     Dim objFileSystem
  436.     If Wscript.Arguments.Count > 0 Then
  437.         strFlag = Wscript.arguments.Item(0)
  438.     End If
  439.     If IsEmpty(strFlag) Then                'No arguments have been received
  440.         Wscript.Echo("Arguments are Required." )
  441.         intParseCmdLine = CONST_ERROR
  442.         Exit Function
  443.     End If
  444.     'Check if the user is asking for help or is just confused
  445.     If (strFlag="help" ) OR (strFlag="/h" ) OR (strFlag="\h" ) OR (strFlag="-h" ) _
  446.         OR (strFlag = "\?" ) OR (strFlag = "/?" ) OR (strFlag = "?" ) _
  447.         OR (strFlag="h" ) Then
  448.         intParseCmdLine = CONST_SHOW_USAGE
  449.         Exit Function
  450.     End If
  451.     'Retrieve the command line and set appropriate variables
  452.      intArgIter = 0
  453.     Do While intArgIter <= Wscript.arguments.Count - 1
  454.         Select Case Left(LCase(Wscript.arguments.Item(intArgIter)),2)
  455.  
  456.             Case "/s"
  457.                 intParseCmdLine = CONST_PROCEED
  458.                 If Not blnGetArg("Server", strServer, intArgIter) Then
  459.                     intParseCmdLine = CONST_ERROR
  460.                     Exit Function
  461.                 End If
  462.                 intArgIter = intArgIter + 1
  463.             Case "/o"
  464.                 If Not blnGetArg("Output File", strOutputFile, intArgIter) Then
  465.                     intParseCmdLine = CONST_ERROR
  466.                     Exit Function
  467.                 End If
  468.                 intArgIter = intArgIter + 1
  469.             Case "/u"
  470.                 If Not blnGetArg("User Name", strUserName, intArgIter) Then
  471.                     intParseCmdLine = CONST_ERROR
  472.                     Exit Function
  473.                 End If
  474.                 intArgIter = intArgIter + 1
  475.             Case "/w"
  476.                 If Not blnGetArg("User Password", strPassword, intArgIter) Then
  477.                     intParseCmdLine = CONST_ERROR
  478.                     Exit Function
  479.                 End If
  480.                 intArgIter = intArgIter + 1
  481.            
  482.             Case "/f"
  483.                 blnForce = True
  484.                 intArgIter = intArgIter + 1
  485.             Case "/r"
  486.                 blnReBoot = True
  487.                 userarray(0) = blnReBoot
  488.                 intArgIter = intArgIter + 1
  489.             Case "/q"
  490.                 blnPowerOff = True
  491.                 userarray(1) = blnPowerOff
  492.                 intArgIter = intArgIter + 1
  493.             Case "/l"
  494.                 blnLogOff = True
  495.                 userarray(2) = blnLogoff
  496.                 intArgIter = intArgIter + 1
  497.             Case "/p"
  498.                 blnShutDown = True
  499.                 userarray(3) = blnShutDown
  500.                 intArgIter = intArgIter + 1
  501.             Case "/t"
  502.                 If Not blnGetArg("Timer", intTimer, intArgIter) Then
  503.                     intParseCmdLine = CONST_ERROR
  504.                     Exit Function
  505.                 End If
  506.                 intArgIter = intArgIter + 1
  507.             Case Else 'We shouldn't get here
  508.                 Call Wscript.Echo("Invalid or misplaced parameter: " _
  509.                    & Wscript.arguments.Item(intArgIter) & vbCRLF _
  510.                    & "Please check the input and try again," & vbCRLF _
  511.                    & "or invoke with '/?' for help with the syntax." )
  512.                 Wscript.Quit
  513.         End Select
  514.     Loop '** intArgIter <= Wscript.arguments.Count - 1
  515.     MyCount = 0
  516.     for i = 0 to 3
  517.         if userarray(i) = True then
  518.             MyCount = Mycount + 1
  519.         End if
  520.     Next
  521.    if Mycount > 1 then
  522.         intParseCmdLine = CONST_SHOW_USAGE
  523.    End if
  524.     If IsEmpty(intParseCmdLine) Then
  525.         intParseCmdLine = CONST_ERROR
  526.         Wscript.Echo("Arguments are Required." )
  527.     End If
  528. End Function
  529. '********************************************************************
  530. '*
  531. '* Sub ShowUsage()
  532. '*
  533. '* Purpose: Shows the correct usage to the user.
  534. '*
  535. '* Input:   None
  536. '*
  537. '* Output:  Help messages are displayed on screen.
  538. '*
  539. '********************************************************************
  540. Private Sub ShowUsage()
  541.     Wscript.Echo ""
  542.     Wscript.Echo "Logoffs, Reboots, Powers Off, or Shuts Down a machine."
  543.     Wscript.Echo ""
  544.     Wscript.Echo "SYNTAX:"
  545.     Wscript.Echo "  Restart.vbs [/S <server>] [/U <username>] [/W <password>]"
  546.     Wscript.Echo "              [/O <outputfile>] </L> </R> </P> </Q> </F> [/T <time in seconds>]"
  547.     Wscript.Echo ""
  548.     Wscript.Echo "PARAMETER SPECIFIERS:"
  549.     wscript.echo "   /T            Amount of time to perform the function."
  550.     Wscript.Echo "   /Q            Perform Shutdown."
  551.     Wscript.Echo "   /P            Perform Poweroff."
  552.     Wscript.Echo "   /R            Perform Reboot."
  553.     Wscript.Echo "   /L            Perform Logoff."
  554.     Wscript.Echo "   /F            Force Function."
  555.     Wscript.Echo "   server        A machine name."
  556.     Wscript.Echo "   username      The current user's name."
  557.     Wscript.Echo "   password      Password of the current user."
  558.     Wscript.Echo "   outputfile    The output file name."
  559.     Wscript.Echo ""
  560.     Wscript.Echo "EXAMPLE:"
  561.     Wscript.Echo "1. cscript Restart.vbs /S MyMachine2 /R"
  562.     Wscript.Echo "   Reboots the current machine MyMachine2."
  563.     Wscript.Echo "2. cscript Restart.vbs /S MyMachine2 /R /F"
  564.     Wscript.Echo "   Forces MyMachine2 to reboot."
  565.     Wscript.Echo "3. cscript Restart.vbs /S MyMachine2 /R /T 30"
  566.     Wscript.Echo "   Reboots the current machine MyMachine2 in 30 seconds."
  567.     Wscript.Echo "NOTE:"
  568.     Wscript.Echo "   The force option will make the machine perform the function even " _
  569.                & "if there are"
  570.     Wscript.Echo "   open and unsaved docuements on the screen."
  571. End Sub
  572. '********************************************************************
  573. '* General Routines
  574. '********************************************************************
  575. '********************************************************************
  576. '*
  577. '* Function strPackString()
  578. '*
  579. '* Purpose: Attaches spaces to a string to increase the length to intWidth.
  580. '*
  581. '* Input:   strString   a string
  582. '*          intWidth    the intended length of the string
  583. '*          blnAfter    Should spaces be added after the string?
  584. '*          blnTruncate specifies whether to truncate the string or not if
  585. '*                      the string length is longer than intWidth
  586. '*
  587. '* Output:  strPackString is returned as the packed string.
  588. '*
  589. '********************************************************************
  590. Private Function strPackString( ByVal strString, _
  591.                                 ByVal intWidth,  _
  592.                                 ByVal blnAfter,  _
  593.                                 ByVal blnTruncate)
  594.     ON ERROR RESUME NEXT
  595.     intWidth      = CInt(intWidth)
  596.     blnAfter      = CBool(blnAfter)
  597.     blnTruncate   = CBool(blnTruncate)
  598.     If Err.Number Then
  599.         Call Wscript.Echo ("Argument type is incorrect!" )
  600.         Err.Clear
  601.         Wscript.Quit
  602.     End If
  603.     If IsNull(strString) Then
  604.         strPackString = "null" & Space(intWidth-4)
  605.         Exit Function
  606.     End If
  607.     strString = CStr(strString)
  608.     If Err.Number Then
  609.         Call Wscript.Echo ("Argument type is incorrect!" )
  610.         Err.Clear
  611.         Wscript.Quit
  612.     End If
  613.     If intWidth > Len(strString) Then
  614.         If blnAfter Then
  615.             strPackString = strString & Space(intWidth-Len(strString))
  616.         Else
  617.             strPackString = Space(intWidth-Len(strString)) & strString & " "
  618.         End If
  619.     Else
  620.         If blnTruncate Then
  621.             strPackString = Left(strString, intWidth-1) & " "
  622.         Else
  623.             strPackString = strString & " "
  624.         End If
  625.     End If
  626. End Function
  627. '********************************************************************
  628. '*
  629. '*  Function blnGetArg()
  630. '*
  631. '*  Purpose: Helper to intParseCmdLine()
  632. '*
  633. '*  Usage:
  634. '*
  635. '*     Case "/s"
  636. '*       blnGetArg ("server name", strServer, intArgIter)
  637. '*
  638. '********************************************************************
  639. Private Function blnGetArg ( ByVal StrVarName,   _
  640.                              ByRef strVar,       _
  641.                              ByRef intArgIter)
  642.     blnGetArg = False 'failure, changed to True upon successful completion
  643.     If Len(Wscript.Arguments(intArgIter)) > 2 then
  644.         If Mid(Wscript.Arguments(intArgIter),3,1) = ":" then
  645.             If Len(Wscript.Arguments(intArgIter)) > 3 then
  646.                 strVar = Right(Wscript.Arguments(intArgIter), _
  647.                          Len(Wscript.Arguments(intArgIter)) - 3)
  648.                 blnGetArg = True
  649.                 Exit Function
  650.             Else
  651.                 intArgIter = intArgIter + 1
  652.                 If intArgIter > (Wscript.Arguments.Count - 1) Then
  653.                     Call Wscript.Echo( "Invalid " & StrVarName & "." )
  654.                     Call Wscript.Echo( "Please check the input and try again." )
  655.                     Exit Function
  656.                 End If
  657.                 strVar = Wscript.Arguments.Item(intArgIter)
  658.                 If Err.Number Then
  659.                     Call Wscript.Echo( "Invalid " & StrVarName & "." )
  660.                     Call Wscript.Echo( "Please check the input and try again." )
  661.                     Exit Function
  662.                 End If
  663.                 If InStr(strVar, "/" ) Then
  664.                     Call Wscript.Echo( "Invalid " & StrVarName)
  665.                     Call Wscript.Echo( "Please check the input and try again." )
  666.                     Exit Function
  667.                 End If
  668.                 blnGetArg = True 'success
  669.             End If
  670.         Else
  671.             strVar = Right(Wscript.Arguments(intArgIter), _
  672.                      Len(Wscript.Arguments(intArgIter)) - 2)
  673.             blnGetArg = True 'success
  674.             Exit Function
  675.         End If
  676.     Else
  677.         intArgIter = intArgIter + 1
  678.         If intArgIter > (Wscript.Arguments.Count - 1) Then
  679.             Call Wscript.Echo( "Invalid " & StrVarName & "." )
  680.             Call Wscript.Echo( "Please check the input and try again." )
  681.             Exit Function
  682.         End If
  683.         strVar = Wscript.Arguments.Item(intArgIter)
  684.         If Err.Number Then
  685.             Call Wscript.Echo( "Invalid " & StrVarName & "." )
  686.             Call Wscript.Echo( "Please check the input and try again." )
  687.             Exit Function
  688.         End If
  689.         If InStr(strVar, "/" ) Then
  690.             Call Wscript.Echo( "Invalid " & StrVarName)
  691.             Call Wscript.Echo( "Please check the input and try again." )
  692.             Exit Function
  693.         End If
  694.         blnGetArg = True 'success
  695.     End If
  696. End Function
  697. '********************************************************************
  698. '*
  699. '* Function blnConnect()
  700. '*
  701. '* Purpose: Connects to machine strServer.
  702. '*
  703. '* Input:   strServer       a machine name
  704. '*          strNameSpace    a namespace
  705. '*          strUserName     name of the current user
  706. '*          strPassword     password of the current user
  707. '*
  708. '* Output:  objService is returned  as a service object.
  709. '*          strServer is set to local host if left unspecified
  710. '*
  711. '********************************************************************
  712. Private Function blnConnect(ByVal strNameSpace, _
  713.                             ByVal strUserName,  _
  714.                             ByVal strPassword,  _
  715.                             ByRef strServer,    _
  716.                             ByRef objService)
  717.     ON ERROR RESUME NEXT
  718.     Dim objLocator, objWshNet
  719.     blnConnect = False     'There is no error.
  720.     'Create Locator object to connect to remote CIM object manager
  721.     Set objLocator = CreateObject("WbemScripting.SWbemLocator" )
  722.     If Err.Number then
  723.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & _
  724.                            " occurred in creating a locator object." )
  725.         If Err.Description <> "" Then
  726.             Call Wscript.Echo( "Error description: " & Err.Description & "." )
  727.         End If
  728.         Err.Clear
  729.         blnConnect = True     'An error occurred
  730.         Exit Function
  731.     End If
  732.     'Connect to the namespace which is either local or remote
  733.     Set objService = objLocator.ConnectServer (strServer, strNameSpace, _
  734.        strUserName, strPassword)
  735.     ObjService.Security_.impersonationlevel = 3
  736.     If Err.Number then
  737.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & _
  738.                            " occurred in connecting to server " _
  739.            & strServer & "." )
  740.         If Err.Description <> "" Then
  741.             Call Wscript.Echo( "Error description: " & Err.Description & "." )
  742.         End If
  743.         Err.Clear
  744.         blnConnect = True     'An error occurred
  745.     End If
  746.     'Get the current server's name if left unspecified
  747.     If IsEmpty(strServer) Then
  748.         Set objWshNet = CreateObject("Wscript.Network" )
  749.     strServer     = objWshNet.ComputerName
  750.     End If
  751. End Function
  752. '********************************************************************
  753. '*
  754. '* Sub      VerifyHostIsCscript()
  755. '*
  756. '* Purpose: Determines which program is used to run this script.
  757. '*
  758. '* Input:   None
  759. '*
  760. '* Output:  If host is not cscript, then an error message is printed
  761. '*          and the script is aborted.
  762. '*
  763. '********************************************************************
  764. Sub VerifyHostIsCscript()
  765.     ON ERROR RESUME NEXT
  766.     Dim strFullName, strCommand, i, j, intStatus
  767.     strFullName = WScript.FullName
  768.     If Err.Number then
  769.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & " occurred." )
  770.         If Err.Description <> "" Then
  771.             Call Wscript.Echo( "Error description: " & Err.Description & "." )
  772.         End If
  773.         intStatus =  CONST_ERROR
  774.     End If
  775.     i = InStr(1, strFullName, ".exe", 1)
  776.     If i = 0 Then
  777.         intStatus =  CONST_ERROR
  778.     Else
  779.         j = InStrRev(strFullName, "\", i, 1)
  780.         If j = 0 Then
  781.             intStatus =  CONST_ERROR
  782.         Else
  783.             strCommand = Mid(strFullName, j+1, i-j-1)
  784.             Select Case LCase(strCommand)
  785.                 Case "cscript"
  786.                     intStatus = CONST_CSCRIPT
  787.                 Case "wscript"
  788.                     intStatus = CONST_WSCRIPT
  789.                 Case Else       'should never happen
  790.                     Call Wscript.Echo( "An unexpected program was used to " _
  791.                                        & "run this script." )
  792.                     Call Wscript.Echo( "Only CScript.Exe or WScript.Exe can " _
  793.                                        & "be used to run this script." )
  794.                     intStatus = CONST_ERROR
  795.                 End Select
  796.         End If
  797.     End If
  798.     If intStatus <> CONST_CSCRIPT Then
  799.         Call WScript.Echo( "Please run this script using CScript." & vbCRLF & _
  800.              "This can be achieved by" & vbCRLF & _
  801.              "1. Using ""CScript Restart.vbs arguments"" for Windows 95/98 or" _
  802.              & vbCRLF & "2. Changing the default Windows Scripting Host " _
  803.              & "setting to CScript" & vbCRLF & "    using ""CScript " _
  804.              & "//H:CScript //S"" and running the script using" & vbCRLF & _
  805.              "    ""Restart.vbs arguments"" for Windows NT/2000." )
  806.         WScript.Quit
  807.     End If
  808. End Sub
  809. '********************************************************************
  810. '*
  811. '* Sub WriteLine()
  812. '* Purpose: Writes a text line either to a file or on screen.
  813. '* Input:   strMessage  the string to print
  814. '*          objFile     an output file object
  815. '* Output:  strMessage is either displayed on screen or written to a file.
  816. '*
  817. '********************************************************************
  818. Sub WriteLine(ByVal strMessage, ByVal objFile)
  819.     On Error Resume Next
  820.     If IsObject(objFile) then        'objFile should be a file object
  821.         objFile.WriteLine strMessage
  822.     Else
  823.         Call Wscript.Echo( strMessage )
  824.     End If
  825. End Sub
  826. '********************************************************************
  827. '*
  828. '* Function blnErrorOccurred()
  829. '*
  830. '* Purpose: Reports error with a string saying what the error occurred in.
  831. '*
  832. '* Input:   strIn  string saying what the error occurred in.
  833. '*
  834. '* Output:  displayed on screen
  835. '*
  836. '********************************************************************
  837. Private Function blnErrorOccurred (ByVal strIn)
  838.     If Err.Number Then
  839.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & ": " & strIn)
  840.         If Err.Description <> "" Then
  841.             Call Wscript.Echo( "Error description: " & Err.Description)
  842.         End If
  843.         Err.Clear
  844.         blnErrorOccurred = True
  845.     Else
  846.         blnErrorOccurred = False
  847.     End If
  848. End Function
  849. '********************************************************************
  850. '*
  851. '* Function blnOpenFile
  852. '*
  853. '* Purpose: Opens a file.
  854. '*
  855. '* Input:   strFileName  A string with the name of the file.
  856. '*
  857. '* Output:  Sets objOpenFile to a FileSystemObject and setis it to
  858. '*            Nothing upon Failure.
  859. '*
  860. '********************************************************************
  861. Private Function blnOpenFile(ByVal strFileName, ByRef objOpenFile)
  862.     ON ERROR RESUME NEXT
  863.     Dim objFileSystem
  864.     Set objFileSystem = Nothing
  865.     If IsEmpty(strFileName) OR strFileName = "" Then
  866.         blnOpenFile = False
  867.         Set objOpenFile = Nothing
  868.         Exit Function
  869.     End If
  870.     'Create a file object
  871.     Set objFileSystem = CreateObject("Scripting.FileSystemObject" )
  872.     If blnErrorOccurred("Could not create filesystem object." ) Then
  873.         blnOpenFile = False
  874.         Set objOpenFile = Nothing
  875.         Exit Function
  876.     End If
  877.     'Open the file for output
  878.     Set objOpenFile = objFileSystem.OpenTextFile(strFileName, 8, True)
  879.     If blnErrorOccurred("Could not open" ) Then
  880.         blnOpenFile = False
  881.         Set objOpenFile = Nothing
  882.         Exit Function
  883.     End If
  884.     blnOpenFile = True
  885. End Function
  886. '********************************************************************
  887. '*                                                                  *
  888. '*                           End of File                            *
  889. '*                                                                  *
  890. '********************************************************************


 
 
 
 
 


---------------
"Tout ce que je sais c'est que je ne sais rien" Socrate
n°1093981
bagu
Posté le 14-03-2003 à 00:57:39  profilanswer
 

Arrrrgggggggghhhhhhhhh !
 
C super indigeste ton truc !

n°1093983
boisorbe
Posté le 14-03-2003 à 00:59:12  profilanswer
 

bagu a écrit :

Arrrrgggggggghhhhhhhhh !
 
C super indigeste ton truc !


 
c'est pas moi c'est by design microsoft ;) Ressource kit inside :D


---------------
"Tout ce que je sais c'est que je ne sais rien" Socrate
n°1093984
JerryCrazy
Le plus crazy des crazy
Posté le 14-03-2003 à 00:59:55  profilanswer
 
n°1093985
JerryCrazy
Le plus crazy des crazy
Posté le 14-03-2003 à 01:01:18  profilanswer
 

pas de nouvelle d'un eventuel SP4 qui regrouperai encore tout les ptit patch?,parce que j'avoue ne plus m'en sortir  :pt1cable:  [:wam]


Message édité par JerryCrazy le 14-03-2003 à 01:01:30

---------------
JerryCrazy - My Digital Life - Ferrovia.be - Jeux Linux
n°1093991
bagu
Posté le 14-03-2003 à 01:21:58  profilanswer
 

PK ?

n°1093997
JerryCrazy
Le plus crazy des crazy
Posté le 14-03-2003 à 01:39:51  profilanswer
 

y en a telement qui sorte  :pt1cable: une foix que je dois m'y retrouver la dedans  [:wam]


---------------
JerryCrazy - My Digital Life - Ferrovia.be - Jeux Linux
n°1094006
bagu
Posté le 14-03-2003 à 02:21:59  profilanswer
 

:lol:

n°1094013
boomboommu​sic
Posté le 14-03-2003 à 02:58:40  profilanswer
 

Merci bcp boisorbe je vais regarder ca de plus pret des que je serait au taff...
c'est vrai que je doute finallement que ce soit le shutdown.exe qui me joue un mauvais tour..je verrais plutot un conflit avec un log que j install...genre microsoft proxy client...

n°1094428
boisorbe
Posté le 14-03-2003 à 13:33:27  profilanswer
 

boomboommusic a écrit :

Merci bcp boisorbe je vais regarder ca de plus pret des que je serait au taff...
c'est vrai que je doute finallement que ce soit le shutdown.exe qui me joue un mauvais tour..je verrais plutot un conflit avec un log que j install...genre microsoft proxy client...


 
a propos de shutdown.exe on a eu des pb avec une version donc prend bien la derniere version ...


---------------
"Tout ce que je sais c'est que je ne sais rien" Socrate
n°1094430
boomboommu​sic
Posté le 14-03-2003 à 13:38:49  profilanswer
 

boisorbe a écrit :


 
a propos de shutdown.exe on a eu des pb avec une version donc prend bien la derniere version ...


 
 :jap:

mood
Publicité
Posté le   profilanswer
 

 Page :   1  2  3  4
Page Suivante

Aller à :
Ajouter une réponse
 

Sujets relatifs
Quelques questions a propos d'un reseau windows 2000Upgrade Exchange 5.5 -> 2000 sans rien perdre ?
strategie de groupe windows 2000equivalent de FormMail pour ISS sous windows
Désactiver la touche "Windows" en mode plein écran?Comment desinstaller un service sur 2000??????
communication unix -> windows 2000 
Plus de sujets relatifs à : Creer un cd de windows 2000 contenant les drivers de son parc info?


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR