Jump to content

problem with netlogon script


Recommended Posts

hello

in first sorry for my poor englis

i've got a problem with a script wich doesnt works when it is launched via a netlogon script

here is the very simple netlogon script :

@echo off

net use i: \\Sioux\public

"C:\Program Files\Support Tools\script_admin.exe"

i:\notes\note.htm

and here is the autoit script

Opt("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 program

le nom du répertoire est incorrect (the name of the directory is incorrect)

fsupdate is in c:\ then i dont see where is the problem

i 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

hello

in first sorry for my poor englis

i've got a problem with a script wich doesnt works when it is launched via a netlogon script

here is the very simple netlogon script :

and here is the autoit script

when 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 problem

i 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

I 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.

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."

 

WindowsError.gif

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

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

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:\

Try just running the command c:\fsupdate.exe" /s from the logon script - without autoit and see if it works.

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."

 

WindowsError.gif

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

i cant because fsupdate need the admin permission to run, i use autoit for the runasset function

How 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 by nitekram

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."

 

WindowsError.gif

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

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 anything

i'll made what you told me to do tomorrow, i'm at home now

How 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

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?

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."

 

WindowsError.gif

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

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

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 by plegrand
Link to comment
Share on other sites

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 by nfwu
Link to comment
Share on other sites

eureka i found the problem.....

Apparently when i use the runasset command the following command "run" might have the directory option informed

before i didnt put anything in this parameter

here is the script wich works

;Cacher l'icône de autoit

Opt("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 administrateur

RunAsSet("Administrateur", @ComputerName, "*****")

;Mise à jour de l'antivirus

Runwait("c:\fsupdate.exe /S", "c:\")

;Suppression des profils

Runwait("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.exe

Runwait(@ComSpec & " /c " & 'del c:\fsupdate.exe', "c:\", @SW_HIDE)

;Récupèration les droits de l'utilisateur

RunAsSet()

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...