Deleting files within a directory through remote 3rd party service - batch-file

I am trying to use a service called LogMeIn to delete folders within a user profile's directory. When run locally, this obviously works. Very simple, as I am fairly new to batch files.
pushd %homepath%\Tracing
Echo Y | DEL *.*
Now, where I run into the problem is when I run it through LogMeIn. This service is for deployment and sends it to all the machines linked to it. It has me put in credentials that will work on all of the machines (network admin) so it can deploy the batch file and there is no way to work around it. Instead of going to C:\Users\tirefire, it now goes to C:\Users\Admin. Any thoughts as how to efficiently navigate to the desired user profile that is currently logged in? Every system is identical. Windows 7 Service Pack 1.
Couldn't find anything online regarding this issue directly. Thanks in advance!

Logmein will only log onto the profile that you have setup to access that computer. For example if your credentials are admin/pass you will get the admin profile, for tirefire/pass you will log on as TireFire.
Prior to logging in you will not be able to see who is logged in.
This is not the answer your looking for but it is the limitation of the software.
You could use a batch like:
CD..
FOR /D %%P IN (*.*) DO DEL /S/Q %%P\TRACING\*.*
This will look in the folders under c:\users (/D) and assign all user folders to the variable (%%P) and delete (DO DEL) anything in the tracing folder (%%P\TRACING*.*) for all users on the machine.
Source: I use logmein daily to log onto machines that we service.

Related

Call webservice from batch file calling in scheduled task

It's several days I search for a problem. I've create an Intranet (Authenticate mode windows allow member of domain) and I a webservice can be called by asmx file
I create a bat file to be use in scheduled task
#echo off
start /MIN iexplore.exe http://server/WS.asmx/Importation
Timeout /T 80 /NoBreak>NUL
taskkill /F /IM iexplore.exe /T
Until now it was good. But from severals days now I don't see the calling asmx correctly (I create a log file and it's empty.
When I call this WebService from my Intranet : it's Ok
I notice now when I run my batch file manually it's ask me a username and password
I look several sample but don't find the good option.
Why Ask me a password when my task have the goods credentials. And How open this asmx with a username/password from scheduler?
Thanks for your help
Finally, I found a way...
In Internet option u have a checkbox "activate the protected mode" uncheck it
And I add my Intranet to Intranet Site
Like this server isn't use directly (only resquest by Excel) and like it's inside protected struture. The risk are very limited.
I hope that can help

Azure Active Directory Server 2016 Group Policy Startup Applications (Chrome) not loading on client workstations

Hi I'm trying to implement a Group Policy in our domain that forces Google Chrome to be added to client startup applications. I've added a GPO and added the key:
Computer Configuration > Administrative Templates > System > Logon > Run These Programs at User Logon
In the "Items to run at logon" I've added the path to chrome.exe (with quotes) like so:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
I've then linked to the Object in our Domain's User and Computer OUs.
I've also pushed the update out to clients and confirmed they have updated GP.
However Chrome does not start when users boot into their laptops.
I'm hoping someone can shine a light on what I've done wrong/what I've forgotten to do - any help much appreciated!
Summarize the comment link as a reply to close this issue.
Per duenni1's comment it looks like the most successful way people are reporting is to use the startup folder instead of the logon group policy. "In my opinion the correct solution: use GPP to manage shortcuts in startup menu folder. Simply create a startup shortcuts."
Could throw it in this directory:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
This will launch the program when they login, we do this to force users into our IM client
https://community.spiceworks.com/topic/1369848-run-these-programs-at-user-logon
If you really want this method to work, I'd start troubleshooting here:
1) is there already a GPO in place that will perform Run These Programs at user logon? That may be the winning GPO
GPO Run these programs at user logon not taking effect
2) According to the official docs, no error is a path issue ( I think your usage of quotes is correct but out of curiosity I'd be curious if removing the quotes has a change).
NOTE: If the program does not run, make sure the path is correct. The program does not run (and no error message is displayed) if the path is not found.

login to remote using "mstsc /admin" with password

I want to use mstsc /admin to login to a server silently. My batch file reads the code as
mstsc /v:xxx.xxx.xxx.xxx /admin
But it ask me to enter password. Can anyone help me to skip this step?
I went on to Google and found this site. But I am very new to this stuff (scripting) and could not understand what to do with given code. Is it a vbscript file? Can I do the same thing with a batch file. Please elaborate and I request you to spoon feed. This is not my arena but still I am pushed to fight without weapons.
My basic need is to kick off all users from a remote desktop except mine to perform some maintainable work. Thanks.
Re-posted as an answer:
Found an alternative (Tested in Win8):
cmdkey /generic:"<server>" /user:"<user>" /pass:"<pass>"
Run that and if you run:
mstsc /v:<server>
You should not get an authentication prompt.
the command posted by Milad and Sandy did not work for me with mstsc. i had to add TERMSRV to the /generic switch. i found this information here: https://gist.github.com/jdforsythe/48a022ee22c8ec912b7e
cmdkey /generic:TERMSRV/<server> /user:<username> /pass:<password>
i could then use mstsc /v:<server> without getting prompted for the login.
to be secured, you should execute 3 commands :
cmdkey /generic:"server-address" /user:"username" /pass:"password"
mstsc /v:server-address
cmdkey /delete:server-address
first command to save the credential
second command to open remote desktop
and the third command to delete the credential for security reason
all of these commands can be saved in a batch file(bat).
(if you save these command in a batch file, third command will not be executed until you close the remote desk)
Same problem but #Angelo answer didn't work for me, because I'm using same server with different credentials. I used the approach below and tested it on Windows 10.
cmdkey /add:server01 /user:<username> /pass:<password>
Then used mstsc /v:server01 to connect to the server.
The point is to use names instead of ip addresses to avoid conflict between credentials. If you don't have a DNS server locally accessible try c:\windows\system32\drivers\etc\hosts file.
It became a popular question and I got a notification. I am sorry, I forgot to answer before which I should have done. I solved it long back.
net use \\10.100.110.120\C$ MyPassword /user:domain\username /persistent:Yes
Run it in a batch file and you should get what you are looking for.
Save your username, password and sever name in an RDP file and run the RDP file from your script
The Command mentioned above didn't work for me (Windows 11)
cmdkey /generic:"server-address" /user:"username" /pass:"password"
When i listed the cmdkeys using the commad:
cmdkey /list
I saw, that a legacy target was added. Adding a specific TERMSRV-Target worked for me:
cmdkey /add:Domain:target=TERMSRV/<SERVER> /user:<DOMAIN>\<USER> /pass:<PASSWORD>

Recess framework stops me editing any files

I have installed Recess and created an app. However I cannot do anything with the files the app created, I can not edit, delete, move the files. When I try and delete i get a FTP error of 550. Any other files on the server I can modify any way I like.
I have found the user has been set to apache I can manually change this but why does it set this as the owner to start with?
It seems that you're running Apache with that user, therefore, when a www app creates something, it will create it with "apache" user. Send more details.

Change owner of file uploaded in server

I have trying to overwrite or perform some file operation to the files uploaded in a webserver.
Previously I have uploaded the files from joomla extension. It defined its owner as 99. Without changing its owner it my login name i am unable to perform file operation using ftp and cpanel.
what can be done?
You could enable the FTP layer of Joomla.
It does depend a bit on how your hosting sets permissions (whether they use ACL's, etc), but the FTP layer of Joomla is designed to get around exactly this issue.
Documentation for this feature is here:
http://help.joomla.org/content/view/1941/302/1/2/

Resources