/build/static/layout/Breadcrumb_cap_w.png

Creating a script

Hello all,

 

Maybe I haven't understood the scripting very well, that's why I am asking for help. I am trying to create a very simple script in which I map a network drive and I want to apply it to a test virtual machine.

 

I have created a batch file with the necessary command and I went to Scripting, Scripts, Add New Item and I selected to create an Offline script with name "Map Drive" , Status "Example" , I enabled it , I deploy it to a specific machine , I select the OS , I select "Do not run on a schedule" and I have checked the "Also run at user log in".

 

When I save it I run it immediately and in Run now status I see that 1 script is pushed succesfully and one script is completed succesfully. I forgot to mention that I have uploaded the bat file in Dependencies.

But after this, when I go to log in from the test computer, I see nothing.

 

When I go back to the script and check the Scheduling, except the "Also run at user logon" which I have it selected, I see also checked the "Allow run while logged off".

 

What do I do wrong?

 

Thank you!!!


0 Comments   [ + ] Show comments

Answers (3)

Posted by: jdornan 11 years ago
Red Belt
0

You could do the same hting through the enforce regsitry settings wizard

Like the following registry entry.

This code will add a persistent mapping for “L” drive into the registry.

[HKEY_CURRENT_USER\Network\L] 
“RemotePath”=”\\\\MyServerName\\MyMappedFolder”
“UserName”=dword:00000000
“ProviderName”=”Microsoft Windows Network”
“ProviderType”=dword:00020000
“ConnectionType”=dword:00000001
“DeferFlags”=dword:00000004

 

Posted by: SMal.tmcc 11 years ago
Red Belt
0

You need an online script, the offline script runs as system and system does not have rights to the network share you are trying to map.

Posted by: elvenil 11 years ago
Senior Purple Belt
0

OK, I changed it to online but now, in the Scheduling area I don't have any "run at user log in". And I need this to be run at user log in, or I want somehow the settings to stay permanenlty. I cannot use the scheduling because I don't know when a user logs in.


Comments:
  • Are you using NET USE in your bat? If you want the mapping to stay use /Persistent:Yes. - dugullett 11 years ago
  • are all these machines in the same domain. If so create a ad group and add a line to the login script if user is member of group map the drive. If everyone who uses a machine will need this mapping you can also use an offline script to push a run command to the registry HKLM\software\microsoft\windows\currentversion\run - SMal.tmcc 11 years ago
    • to push a reg change
      reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v mapxdrive /d "net use x: \\server\share" - SMal.tmcc 11 years ago
  • Sorry for my delayed answer. Yes I am using the NET USE command and I also use the /Persistent:yes

    All the machines are in the same domain and I am trying to test with a machine which actually belongs to me (domain admin). All the users are using their own computers and nobody else is working on them.

    Still doesn't work. (SMal.tmcc I didn't follow your advice. Isn't there any other seasier way to do it?)

    Thank you all! - elvenil 11 years ago
    • add the net use line to the domain login.bat file - SMal.tmcc 11 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ