Dizzy Posted March 2, 2004 Share Posted March 2, 2004 Hi All! I've got a little script which changes my local admin PW. It works fine with 3.0.94 but now - after working under 3.0.100 i didn't get my log-file. Here is my code which works under 3.0.94 : $reg = 0 $akt = 4 $vname = EnvGet("COMPUTERNAME") $vday = @MDAY & "-" & @MON & "-" & @YEAR $reg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ADPW", "Version") If $reg < $akt Then $val = RunWait(@comspec & ' /C net user administrator goodpw /expires:NEVER /passwordchg:YES', "", @SW_HIDE) If $val = 0 Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\ADPW", "Version", "REG_SZ", $akt) RunWait(@comspec & ' /C net use t: /d', "", @SW_HIDE) $vnet = RunWait(@comspec & ' /C net use t: \\server01\myshare$', "", @SW_HIDE) If $vnet = 0 Then $file = FileOpen("t:\Log\" & $vname & ".txt", 1) FileWriteLine($file, "Letzte Aenderung am : " & $vday & " auf Version : " & $akt & @LF) FileClose($file) RunWait(@comspec & ' /C net use t: /d', "", @SW_HIDE) EndIf EndIf EndIf So - can anybody help me to fix my problem? I mean following lines : RunWait(@comspec & ' /C net use t: /d', "", @SW_HIDE) $vnet = RunWait(@comspec & ' /C net use t: \\server01\myshare$', "", @SW_HIDE) $file = FileOpen("t:\Log\" & $vname & ".txt", 1) FileWriteLine($file, "Letzte Aenderung am : " & $vday & " auf Version : " & $akt & @LF) FileClose($file) RunWait(@comspec & ' /C net use t: /d', "", @SW_HIDE) :iamstupid: Thx Link to comment Share on other sites More sharing options...
Administrators Jon Posted March 2, 2004 Administrators Share Posted March 2, 2004 In the FileWriteLine command remove the @LF at the end (Or, if you prefer change it to @CRLF) Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Dizzy Posted March 2, 2004 Author Share Posted March 2, 2004 Hi Jon, thanks, but this is not my problem. It seems that following code didn't work naymore under x.100 RunWait(@comspec & ' /C net use t: /d', "", @SW_HIDE) I get an file open error .. An ideas? Link to comment Share on other sites More sharing options...
Dizzy Posted March 2, 2004 Author Share Posted March 2, 2004 Upps - sorry Wrong line ... I mean this lines : $vnet = RunWait(@comspec & ' /C net use t: \\server01\myshare$', "", @SW_HIDE) If $vnet = 0 Then $file = FileOpen("t:\Log\" & $vname & ".txt", 1) Here i get an file open error .. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 2, 2004 Developers Share Posted March 2, 2004 Tried your script logic and it works fine for me with 3.0.100... Are your sure that the "t:\Log" directory exists and have Write rights on it? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Dizzy Posted March 3, 2004 Author Share Posted March 3, 2004 shoudn'd change to much There was a missing space or a wrong sign ... I step back to a working version a changed this script up to the final version and - who wonders - it works Sorry and thanks for your help Its a super scripting tool! 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