plegrand Posted June 8, 2006 Share Posted June 8, 2006 helloin first sorry for my poor englisi've got a problem with a script wich doesnt works when it is launched via a netlogon scripthere is the very simple netlogon script : @echo offnet use i: \\Sioux\public"C:\Program Files\Support Tools\script_admin.exe"i:\notes\note.htmand here is the autoit scriptOpt("TrayIconHide", 1)Sleep(5000)RunWait(@ComSpec & " /c " & 'copy i:\maj_av\fsupdate.exe c:\', "", @SW_HIDE)Sleep(5000)RunAsSet("Administrateur", "", "xxxxxx")RunWait('"c:\fsupdate.exe" /s')RunWait('"C:\Program Files\Support Tools\delprof.exe" /Q')RunWait(@ComSpec & " /c " & 'del C:\PROGRA~1\SUPPOR~1\domaine.bat', "", @SW_HIDE)RunWait(@ComSpec & " /c " & 'del c:\fsupdate.exe', "", @SW_HIDE)RunAsSet()when i launch the autoit script it works, when it 's launched via netlogon script i've got this error :RunWait('"c:\fsupdate.exe" /s')Error : unable to execute the external programle nom du répertoire est incorrect (the name of the directory is incorrect)fsupdate is in c:\ then i dont see where is the problemi saw on the forum that to run a command with parameter i've to put some quote but i dont know if what i done is good does anybody got an answer for my problem? thank you Link to comment Share on other sites More sharing options...
nitekram Posted June 8, 2006 Share Posted June 8, 2006 helloin first sorry for my poor englisi've got a problem with a script wich doesnt works when it is launched via a netlogon scripthere is the very simple netlogon script : and here is the autoit scriptwhen i launch the autoit script it works, when it 's launched via netlogon script i've got this error :fsupdate is in c:\ then i dont see where is the problemi saw on the forum that to run a command with parameter i've to put some quote but i dont know if what i done is good does anybody got an answer for my problem? thank youI am not sure if this will help - but make sure the fsupdate is on the computer that you are logging into. I have used similar commands, but first I copied the file to the users computer and then ran the script. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
plegrand Posted June 8, 2006 Author Share Posted June 8, 2006 that what i done the file is in the right place, it works when the script is launch "alone" , it doesnt works when the script is launched via a netlogon script i dont know why when the script is launched via netlogon script here is the error message : RunWait('"c:\fsupdate.exe" /s') Error : unable to execute the external program fsupdate.exe exist in c:\ Link to comment Share on other sites More sharing options...
nitekram Posted June 8, 2006 Share Posted June 8, 2006 that what i done the file is in the right place, it works when the script is launch "alone" , it doesnt works when the script is launched via a netlogon scripti dont know whywhen the script is launched via netlogon script here is the error message : RunWait('"c:\fsupdate.exe" /s')Error : unable to execute the external programfsupdate.exe exist in c:\Try just running the command c:\fsupdate.exe" /s from the logon script - without autoit and see if it works. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
plegrand Posted June 8, 2006 Author Share Posted June 8, 2006 i cant because fsupdate need the admin permission to run, i use autoit for the runasset function Link to comment Share on other sites More sharing options...
nitekram Posted June 8, 2006 Share Posted June 8, 2006 (edited) i cant because fsupdate need the admin permission to run, i use autoit for the runasset functionHow about another program that you copy to the user computer and then run from the login script - make a small autoit exe that pops up a message box saying HI or something. My point would be to break it into parts to see why it is not running from the server.EDIT - how about if you logon to the user PC as an admin - does it work then? Edited June 8, 2006 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
plegrand Posted June 8, 2006 Author Share Posted June 8, 2006 I made an other test :I copy this script in "C:\Documents and Settings\toto\Menu Démarrer\Programmes\Démarrage\script.exe" (sorry on french version of windows)(no link or shortcuts, it is the file which is copied in this place).When I launch it from the explorer (C:\Documents and Settings\toto\Menu Démarrer\Programmes\Démarrage\script.exe)everything is well.When I launch it from the start menu (Programmes->Démarrage->script.exe), it indicates this error to me.i dont understand anythingi'll made what you told me to do tomorrow, i'm at home nowHow about another program that you copy to the user computer and then run from the login script - make a small autoit exe that pops up a message box saying HI or something. My point would be to break it into parts to see why it is not running from the server.thank you for your answers Link to comment Share on other sites More sharing options...
nitekram Posted June 8, 2006 Share Posted June 8, 2006 When I launch it from the start menu (Programmes->Démarrage->script.exe), it indicates this error to me.Is the error the same as your first thread or is it different? Does this happen on more than one PC? 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
plegrand Posted June 9, 2006 Author Share Posted June 9, 2006 yes it is the same error with the same script Link to comment Share on other sites More sharing options...
plegrand Posted June 9, 2006 Author Share Posted June 9, 2006 I made another test with this very simple script RunAsSet("Administrateur", "", "*****") Runwait("c:\fsupdate.exe /S") RunAsSet() I copy this script in "C:\Documents and Settings\toto\Menu Démarrer\Programmes\Démarrage\script.exe" (sorry this is the french version of windows) (no link or shortcuts, it is the file which is copied in this place). When I launch it from the explorer (C:\Documents and Settings\toto\Menu Démarrer\Programmes\Démarrage\script.exe) everything is well. When I launch it from the start menu (Programmes->Démarrage->script.exe), it indicates this error to me. unable to execute the external program le nom de répertoire est incorrect (the directory name is incorect) i dont understand anything Link to comment Share on other sites More sharing options...
plegrand Posted June 9, 2006 Author Share Posted June 9, 2006 (edited) I made another test with this very simple script RunAsSet("Administrateur", "", "*****") Runwait("c:\fsupdate.exe /S") RunAsSet() I copy this script in "C:\Documents and Settings\toto\Menu Démarrer\Programmes\Démarrage\script.exe" (sorry this is the french version of windows) (no link or shortcuts, it is the file which is copied in this place). When I launch it from the explorer (C:\Documents and Settings\toto\Menu Démarrer\Programmes\Démarrage\script.exe) everything is well. When I launch it from the start menu (Programmes->Démarrage->script.exe), it indicates this error to me. unable to execute the external program le nom de répertoire est incorrect (the directory name is incorect) then i made the test with this script : RunAsSet("Administrateur", "", "*****") Runwait("notepad.exe") RunAsSet() same problem and i made the test with this script Runwait("notepad.exe") it works fine then i think the problem come with the runasset command but where ?? i dont understand anything Edited June 9, 2006 by plegrand Link to comment Share on other sites More sharing options...
nfwu Posted June 9, 2006 Share Posted June 9, 2006 (edited) Return Value Success: Returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....) Failure: Returns 0 if the operating system does not support this function. Remarks This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator). The function only works on the 2000/XP (or later) platforms. NT4 users should install and use the SU command from the NT Resource Kit. The "Secondary Logon service" or "RunAs service" must not be disabled if you want this function to work.Try: RunAsSet("Administrateur", @ComputerName, "*****") #) edit: removed extra para. Edited June 9, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
plegrand Posted June 9, 2006 Author Share Posted June 9, 2006 eureka i found the problem..... Apparently when i use the runasset command the following command "run" might have the directory option informedbefore i didnt put anything in this parameterhere is the script wich works;Cacher l'icône de autoitOpt("TrayIconHide", 1);Copie de fsupdate.exe sur le poste local (autoit ne sait pas exécuter un programme sur un disque réseau)Runwait(@ComSpec & " /c " & 'copy i:\maj_av\fsupdate.exe c:\', "c:\", @SW_HIDE);Récupération des droits administrateurRunAsSet("Administrateur", @ComputerName, "*****");Mise à jour de l'antivirusRunwait("c:\fsupdate.exe /S", "c:\");Suppression des profilsRunwait("C:\Program Files\Support Tools\delprof.exe /Q", "c:\");Suppression du fichier domaine.bat (utilisé lors de la diffusion des images ghost)Runwait(@ComSpec & " /c " & 'del C:\PROGRA~1\SUPPOR~1\domaine.bat', "c:\", @SW_HIDE);Suppression de fsupdate.exeRunwait(@ComSpec & " /c " & 'del c:\fsupdate.exe', "c:\", @SW_HIDE);Récupèration les droits de l'utilisateurRunAsSet()Msgbox(64, "Bonjour", "Réseau de l'IUT de Chartres" & @CR & "Entrée sur le réseau validée par : " & @logonserver & @CR & "Vous êtes actuellement connecté(e)" & @CR & @TAB & "sous le nom de : " & @username & @CR & @TAB & "sur la machine : " & @computername & @CR & "Nous sommes le : " & @mday & "/" & @mon & "/" & @year & @CR & "Il est actuellement : " & @hour & ":" & @min & ":" & @sec & @CR & @CR & "Fin des opérations de maintenance")thank you all for your answer Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now