dcjohnston Posted July 21, 2004 Share Posted July 21, 2004 There is a way right? The script parses an .ini file for a server name. The server name takes the value of $line. ____________________ $file = FileOpen("c:\server.ini", 0) $server = FileReadLine($file, 1) Runwait("net use f: \\$server\vol1\apps") ______________________ Problem is that inside the net use command, I am unable to get the drive to map. I have tried. wrapping in %, and all other information I was able to read and find, including the help file. I dont think the FAQ item addresses my issue. Thanks Dave :iamstupid: Link to comment Share on other sites More sharing options...
Doxie Posted July 21, 2004 Share Posted July 21, 2004 (edited) $server = IniRead ( "myfile.ini", "Headline", "Server", "" ) Run("net use f: "$server & "\vol1\apps /y") Then you .ini file should look like this: [Headline] Server = name of server Runwait("net use f: \\$server\vol1\apps")It should look like this: Runwait("net use f: \\" & $server & "\vol1\apps") But i always work with iniread when i got .ini files Edited July 21, 2004 by Doxie Were ever i lay my script is my home... Link to comment Share on other sites More sharing options...
Doxie Posted July 21, 2004 Share Posted July 21, 2004 You can have this as a separate program: $server = InputBox("Server", "Enter Server name", "") IniWrite( "myfile.ini", "Headline", "Server", $server ) This little code will just change your server name in the ini file. AND, you can also use it to create the first .ini file. Were ever i lay my script is my home... Link to comment Share on other sites More sharing options...
dcjohnston Posted July 21, 2004 Author Share Posted July 21, 2004 (edited) Excuse the newb, So no back slashes in the net use command? Also, thanks for the change of .ini function. Dave Edited July 21, 2004 by dcjohnston Link to comment Share on other sites More sharing options...
dcjohnston Posted July 21, 2004 Author Share Posted July 21, 2004 Works like a charm. Thanks for the education. Dave Link to comment Share on other sites More sharing options...
Doxie Posted July 21, 2004 Share Posted July 21, 2004 My misstake I'm used to have the \\ in the ini file...If you gonna use my change server name tool$server = InputBox("Server", "Enter Server name", "") IniWrite( "myfile.ini", "Headline", "Server", "\\"&$server )Otherwise make sure you use \\ in your selfmade .iniOrYou can enter the \\ in the Net Use command directly$server = IniRead ( "myfile.ini", "Headline", "Server", "" ) Run("net use f: \\"$server & "\vol1\apps /y")Hope this help... Were ever i lay my script is my home... 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