Jump to content

Recommended Posts

Hi All! :whistle:

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 post
Share on other sites

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 .. :whistle:

An ideas?

Link to post
Share on other sites

Upps - sorry :whistle:

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 post
Share on other sites
  • Developers

Tried your script logic and it works fine for me with 3.0.100... :whistle:

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 post
Share on other sites

B) shoudn'd change to much :angry::evil:

There was a missing space or a wrong sign ... :whistle:

I step back to a working version a changed this script up to the final version and - who wonders - it works :lmao:

Sorry and thanks for your help

Its a super scripting tool!

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...