martinszutner Posted October 17, 2008 Share Posted October 17, 2008 hI, I dont know the actual razon, but this script don't work in windows vista #RequireAdmin ; Fill in the username and password appropriate for your system. Local $sUserName = "jmfs" Local $sPassword = "PmP123456" ; Run a command prompt as the other user. ;~ Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, @ComSpec, @SystemDir) Local $pid = RunAs($sUserName, @ComputerName, $sPassword, 0, 'CMD.EXE /C NET USE Z: \\SERVIDOR\PMP /PERSISTENT:NO',@SystemDir) ;~ Wait for the process to close. ProcessWaitClose($pid) ; Show a message. MsgBox(0, "", "The process we were waiting for has closed.") if anybody can helpme, I will grateful, PS: I tried other way cfuntion ex drivemapadd and wscrit, examples found on this forum and and none could map a drive Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 17, 2008 Share Posted October 17, 2008 The computer/share you're trying to connect to is named Servidor? If not you should probably change it. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
martinszutner Posted October 17, 2008 Author Share Posted October 17, 2008 The computer/share you're trying to connect to is named Servidor? If not you should probably change it.the server name is correct, but the most curious is if I run on command line net use z: \\servidor\PMPthat work and added. Link to comment Share on other sites More sharing options...
November Posted October 17, 2008 Share Posted October 17, 2008 (edited) Hi thereLocal $pid = RunAs($sUserName, @ComputerName, $sPassword, 0, 'CMD.EXE /C NET USE Z: \\SERVIDOR\PMP /PERSISTENT:NO',@SystemDir)@Systemdir?you can only use : @SW_HIDE = Hidden window (or Default keyword) @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized windowTry to use DriveMapAdd. If you do so you can manage errors!Cheers Edited October 17, 2008 by november Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
ken82m Posted October 17, 2008 Share Posted October 17, 2008 (edited) 1) Try a /K instead of /C this way you can read the error on the command line. 2) Make sure the "Secondary Logon" service is running on the machine your running it from. 3) You could try logging on as the user you are doing the runas with. Disconnect the Z: drive. And just do a straight run, see if the drive maps that way. -Kenny Edited October 17, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
ken82m Posted October 17, 2008 Share Posted October 17, 2008 (edited) @Systemdir?you can only use :@SW_HIDE = Hidden window (or Default keyword)@SW_MINIMIZE = Minimized window@SW_MAXIMIZE = Maximized windowTry to use DriveMapAdd. If you do so you can manage errors!CheersHe's got it right, the working directory is in that position, the display flag is the next one over.-Kenny Edited October 17, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
November Posted October 17, 2008 Share Posted October 17, 2008 He's got it right, the working directory is in that position, the display flag is the next one over.-KennyYeap He's right allright!Thou i think if he use all in one script languange would be better... just my personal opinion!Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
martinszutner Posted October 17, 2008 Author Share Posted October 17, 2008 1) Try a /K instead of /C this way you can read the error on the command line.2) Make sure the "Secondary Logon" service is running on the machine your running it from.3) You could try logging on as the user you are doing the runas with. Disconnect the Z: drive. And just do a straight run, see if the drive maps that way.-KennyThanks, I use your recomendation and work only from DOS command line. well, and when I close DOS windows the Z: unit is deleted. I think this windows vista make a different application layer. or anything similiar.Otherway is use DRIVEMAPADD, but don´t work.Any other option or what is my mistake? Link to comment Share on other sites More sharing options...
ken82m Posted October 17, 2008 Share Posted October 17, 2008 (edited) when you ran the autoit script with /K what error did you get?What was the @error code from DriveMapAdd?_____________________________________________EDIT: You could try turning off user account control: http://www.petri.co.il/disable_uac_in_windows_vista.htmThough I don't believe it would cause you a problem with this. Unfortunately my laptop is on XP so I can't try it myself.-Kenny Edited October 17, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
ken82m Posted October 17, 2008 Share Posted October 17, 2008 (edited) hold on I think I know what's happening. Can you send me some more of your code? What are you trying to do after you get the drive mapped? _____________________________________ Try this: #RequireAdmin ; Fill in the username and password appropriate for your system. Local $sUserName = "jmfs" Local $sPassword = "PmP123456" DriveMapDel("Z:") $1 = DriveMapAdd("Z:", "\\SERVIDOR\PMP", 0, @ComputerName & "\" & $sUserName, $sPassword) $2 = @error MsgBox(0, "Return", $1) MsgBox(0, "@error", $2) If it doesn't work send me the codes you get from the message boxes. -Kenny Edited October 17, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
martinszutner Posted October 17, 2008 Author Share Posted October 17, 2008 hold on I think I know what's happening.Can you send me some more of your code? What are you trying to do after you get the drive mapped?that is all code, I think only make virtual drive to server files, that is all.but this don't work.I know!!!! I can do it in .bat or .cmd, but a like make in autoit. Link to comment Share on other sites More sharing options...
ken82m Posted October 17, 2008 Share Posted October 17, 2008 posted some code above, see if that works, or what results you get. -Kenny "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." 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