i have a logoff VB script (it's from http://www.rlmueller.net/Logon7.htm). it's use for limit login user.
In Win 7 the script run just fine but i've get an error in XP SP2 when i restart the PC :
Script : logoff7.vbs
line : 63
char : 9
Error : Permission denied
code : 800A0046
Source : Microsoft VBScrpt runtime error
below is the code :
' Check if flag file exists for this user.
If (objFSO.FileExists(strFlagFile) = True) Then
' Read encoded computer name from the flag file.
Set objFile = objFSO.OpenTextFile(strFlagFile, ForReading)
strLine = objFile.ReadLine
objFile.Close
' Check encoded computer name.
If (strLine = strComputerEncoded) Then
' Delete the file.
objFSO.DeleteFile strFlagFile
End If
Wscript.Quit
End If
script for line: 63 char: 9 is
objFSO.DeleteFile strFlagFile.
please help me to resolve this problem.
thx before, i'm sorry if my english is not well enough.
Related
I use DCMTK recently and I met a problem.
Purpose: use dcmtk tools to simulate the basic commands in localhost. My OS is Windows. The dcmqrscp.cfg is
NetworkTCPPort = 11112
MaxPDUSize = 16384
MaxAssociations = 16
HostTable BEGIN
acme1 = (ACME1, LAPTOP-DCM81P8J, 1234)
acme2 = (ACME_STORE, localhost, 5678)
acmeCTcompany = acme1, acme2
HostTable END
VendorTable BEGIN
"Acme CT Company" = acmeCTcompany
VendorTable END
AETable BEGIN
ACME_STORE d:\mj\scu RW (100, 1024mb) acmeCTcompany
AETable END
When I used dcmqrscp to enable the config file, the error popped up:
error
I don't find anything wrong in the config file. So what the reason is.
I wrote a script in Matlab on windows system. Now I changed to linux system and I tried to use my script on linux in matlab also. But it does not work.
I got a problem with the data import part of my script:
data = {};
for i = 1:numel(filelist)
filename = filelist{i};
filename = [selpath '\' filename];
delimiter = ',';
startRow = 2;
formatSpec = '%*q%*q%*q%q%[^\n\r]';
fileID = fopen(filename,'r');
dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'TextType', 'string', 'HeaderLines' ,startRow-1, 'ReturnOnError', false, 'EndOfLine', '\r\n');
fclose(fileID);
tmp_data = str2double(dataArray{1});
data{i} = tmp_data;
end
If I run my script I got the following error from matlab:
Error using textscan
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in justus_tem (line 21)
dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'TextType', 'string', 'HeaderLines' ,startRow-1, 'ReturnOnError',
false, 'EndOfLine', '\r\n');
When I run the same script on windows I do not get the Error. In linux system the fileID is always -1
Has somebody a tip or knows what I do wrong? I tried different permissions for fopen but it does not work either.
Linux uses a forward slash (/) as the file separator, you have hard-coded the Windows compatible backward slash (\). Instead, consider either
Using filesep for a system-dependent file separator
filename = [selpath, filesep, filename];
Or use fullfile to build the path for you
filename = fullfile(selpath, filename);
My lua code is something like this:
local savefiletarget = "/usr/local/openresty/nginx/webfolder/img/uploadedimg.jpg".
local fileToSave = io.open(savefiletarget,"w+b")
if not fileToSave then
ngx.log(ngx.NOTICE,'failed to save file : '..savefiletarget);
ngx.say('{"filename" : "'..filenametosave..'","status" : 0 ,"message":"failed to open file"}')
return
end
Log shows the error:
failed to save file : /usr/local/openresty/nginx/webfolder/img/uploadedimg.jpg
I'm using Linux server, do I require permissions to save the image?
Or is there anything I missed?
Currently I am working in Excel vba. I dont know much about it.
I am doing file transfer operation using putty sftp command,
I am using below code for the same.
I have also installed winscp & putty on my pc.
My code is:
Dim shell As Object
Dim command As String
Dim errorCode As Integer
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 0
Set shell = VBA.CreateObject("WScript.Shell")
command = "cmd.exe /c echo y |"C:\Program Files (x86)\PuTTY\pscp.exe"
-sftp -P 22 -l Username_Here -pw Password_Here
SRC_IP_Address_Here:File_Path_Here " " Destination_Path_Here
' error code is 0 if all ok otherwise 1
errorCode = shell.Run(command, windowStyle, waitOnReturn)
Above code works fine if ip address & destination path exists,
but if ip address is not reachable in network excel takes 20-30 seconds for response & errorCode = 1.
Is it possible to modify above code in such a way that it should give me response only within 10 sec?
How can I set putty sftp connection timeout in above code?
I tried following links but not getting any result:
https://patrickmn.com/aside/how-to-keep-alive-ssh-sessions/
https://www.computerhope.com/unix/sftp.htm
https://library.netapp.com/ecmdocs/ECMP1196993/html/GUID-02FF883B-9913-4137-BC8B-5CB47282B944.html
https://tartarus.org/~simon/putty-snapshots/htmldoc/Chapter5.html
I have been developing an application which uses thermal
printers to print receipts.
Until now the following code (PB 11.5) was working as a
charm:
Environment env
GetEnvironment(env)
ls_port= 'LPT1'
ls_command = 'COPY ' + ls_tempfile + ' ' + ls_port
Choose Case env.OSType
Case windows!
ls_command = 'command.com /c ' + ls_command
Case windowsnt!
ls_command = 'cmd.exe /c "' + ls_command + '"'
Case else
ls_command = 'cmd.exe /c "' + ls_command + '"'
End Choose
li_cmd = Run(ls_command,Minimized!)
I have just deployed my application to a big customer with
Win7 64bit PCs and the command does not fire! I cannot print
at all!
I am in an awkard (to say the least) situation.
Can you help me?
Well, the problem was not in the PB Run statement but in a Net Use that I had done. Net Use in LPTx, COMx in Win7 64bit has tons of issues concerning privileges, user rights etc. Even the Print Directly to Printer option inside Printer Properties causes rights issues!! Oh God...